Created
September 26, 2014 16:37
-
-
Save missingfaktor/8bf43f09541fde7dd906 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> def foo[R <: { def f1: Int }](x: R): (R, Int) = (x, x.f1) | |
| foo: [R <: AnyRef{def f1: Int}](x: R)(R, Int) | |
| scala> val x = new { | |
| | def f1 = 90 | |
| | def f2 = "hello" | |
| | } | |
| x: AnyRef{def f1: Int; def f2: String} = $anon$1@adeb0ee | |
| scala> foo(x)._1.f2 | |
| res8: String = hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment