Created
August 31, 2016 13:43
-
-
Save milessabin/55939412017e2da20bcb9047240364f8 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> def narrow[T <: Singleton](t: T): T {} = t | |
narrow: [T <: Singleton](t: T)T | |
scala> narrow(23) | |
res1: 23 = 23 | |
scala> var x = narrow(42) | |
x: 42 = 42 | |
scala> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment