Skip to content

Instantly share code, notes, and snippets.

@brianhsu
Created June 23, 2010 12:40
Show Gist options
  • Select an option

  • Save brianhsu/449871 to your computer and use it in GitHub Desktop.

Select an option

Save brianhsu/449871 to your computer and use it in GitHub Desktop.
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