Created
August 31, 2012 21:01
-
-
Save devth/3558934 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
scala> trait B { def build: Int } | |
defined trait B | |
scala> case class B1() extends B { val build = 1 } | |
defined class B1 | |
scala> case class B2() extends B { val build = 2 } | |
defined class B2 | |
scala> val l: List[() => B] = List(B1, B2) | |
l: List[() => B] = List(B1, B2) | |
scala> case class B3(implicit i: Int) extends B { val build = i } | |
defined class B3 | |
scala> val l2: List[() => B] = List(B1, B2, B3) | |
<console>:14: error: type mismatch; | |
found : B3.type (with underlying type object B3) | |
required: () => B | |
val l2: List[() => B] = List(B1, B2, B3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment