Skip to content

Instantly share code, notes, and snippets.

@theodoreLee
Created April 30, 2013 07:25
Show Gist options
  • Save theodoreLee/5487141 to your computer and use it in GitHub Desktop.
Save theodoreLee/5487141 to your computer and use it in GitHub Desktop.
class Covariance[+T]
val coAny:Covariance[Any] = new Covariance[String]
// coAny: Covariance[Any] = Covariance@33a626ac
val coString:Covariance[String] = new Covariance[Any]
/*<console>:8: error: type mismatch;
found : Covariance[Any]
required: Covariance[String]
val coString:Covariance[String] = new Covariance[Any]
^
*/
val coString:Covariance[String] = new Covariance[String]
//coString: Covariance[String] = Covariance@7ad7aaf9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment