Created
April 4, 2013 04:39
-
-
Save tpolecat/5307872 to your computer and use it in GitHub Desktop.
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
trait Foo[A] | |
implicit val c: Foo[Int] = ??? | |
implicit val d: Foo[String] = ??? | |
def bar[A: Foo]: A = ??? | |
bar: Int // compiles only if Foo is covariant in A ... why? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output of
-Xprint:typer
below. Note the comment which shows the differences between covariant and invariant versions: