Created
July 24, 2015 21:29
-
-
Save SethTisue/c34e3935d1a72be647a8 to your computer and use it in GitHub Desktop.
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
scala> class Outer { class Inner; val i = new Inner } | |
defined class Outer | |
scala> class Outer { class Inner; val i = new Inner; type I2 = (Inner, Inner) } | |
defined class Outer | |
scala> def foo(i: Outer#I2) = () | |
foo: (i: (_7.Inner, _7.Inner) forSome { val _7: Outer })Unit | |
scala> val o1, o2 = new Outer | |
o1: Outer = Outer@3f6f6701 | |
o2: Outer = Outer@3527942a | |
scala> foo((o1.i, o2.i)) | |
<console>:15: error: type mismatch; | |
found : (o1.Inner, o2.Inner) | |
required: (_7.Inner, _7.Inner) forSome { val _7: Outer } | |
foo((o1.i, o2.i)) | |
^ | |
scala> foo((o1.i, o1.i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment