Skip to content

Instantly share code, notes, and snippets.

@SethTisue
Created July 24, 2015 21:29
Show Gist options
  • Save SethTisue/c34e3935d1a72be647a8 to your computer and use it in GitHub Desktop.
Save SethTisue/c34e3935d1a72be647a8 to your computer and use it in GitHub Desktop.
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