Created
January 16, 2013 20:08
-
-
Save sofoklis/4550404 to your computer and use it in GitHub Desktop.
NonVariantType.scala
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
val string: Any = "sofoklis" // String is a proper subtype of any | |
val nonVariantType1: NonVariantType[String] = new NonVariantType[String] // Allowed | |
val nonVariantType2: NonVariantType[Any] = new NonVariantType[String] // Compile error | |
val nonVariantType3: NonVariantType[String] = new NonVariantType[Any] // Compile error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment