Created
January 30, 2013 19:44
-
-
Save asflierl/4676164 to your computer and use it in GitHub Desktop.
Dependent method types in Scala 2.10.... ooooOOOO yeah!
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
| Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_11). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> trait Meep { type Moop; def f: Moop } | |
| defined trait Meep | |
| scala> def fnord(a: Meep): a.Moop = a.f | |
| fnord: (a: Meep)a.Moop |
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
| Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_11). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> trait Meep { type Moop; def f: Moop } | |
| defined trait Meep | |
| scala> def fnord(a: Meep): a.Moop = a.f | |
| <console>:40: error: illegal dependent method type | |
| def fnord(a: Meep): a.Moop = a.f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment