Created
February 5, 2014 11:41
-
-
Save ant8e/8821912 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed abstract trait MetricStyle | |
trait Gauge extends MetricStyle | |
trait Metric extends MetricStyle with MetricValue | |
class IntGauge extends Metric with Gauge { | |
type Value =Int | |
} | |
object MetricOp { | |
abstract class MetricOperation[+T <: Metric](val metric: T) | |
class IncOp[+T <: Metric](metric: T, val value : T#Value) extends MetricOperation[T](metric) | |
} | |
object Toto { | |
import MetricOp._ | |
val g = new IntGauge | |
val t: IncOp[IntGauge] = new IncOp[g.type ](g,0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment