Created
April 30, 2013 07:25
-
-
Save theodoreLee/5487141 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
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