Created
June 23, 2010 12:40
-
-
Save brianhsu/449871 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
| import java.lang.Integer | |
| import java.lang.Number | |
| val i1: Int = (() => 3)() | |
| val i2: java.lang.Integer = (() => 3)() | |
| val i3 = ((x: Int) => x + 1)(3) | |
| val i4 = ((x: Number) => x.intValue)(3.14159) | |
| val o = () => 3 | |
| assert (i1 == 3) | |
| assert (i2 == 3) | |
| assert (i3 == 4) | |
| assert (i4 == 3) | |
| assert (o != null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment