Skip to content

Instantly share code, notes, and snippets.

@sofoklis
Created January 16, 2013 20:08
Show Gist options
  • Save sofoklis/4550404 to your computer and use it in GitHub Desktop.
Save sofoklis/4550404 to your computer and use it in GitHub Desktop.
NonVariantType.scala
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