Created
May 7, 2012 00:12
-
-
Save jorgeortiz85/2625104 to your computer and use it in GitHub Desktop.
dependent method types
This file contains 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
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> class Outer { class Inner } | |
defined class Outer | |
scala> trait DepFun { def apply(x: Outer): x.Inner } | |
defined trait DepFun | |
scala> new DepFun { override def apply(x: Outer): x.Inner = new x.Inner } | |
<console>:10: error: overriding method apply in trait DepFun of type (x: Outer)x.Inner; | |
method apply has incompatible type | |
new DepFun { override def apply(x: Outer): x.Inner = new x.Inner } | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment