Created
September 5, 2012 01:36
-
-
Save tonymorris/3628955 to your computer and use it in GitHub Desktop.
Scala WTF?
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
case class X[A](a: A) | |
object X { | |
// succeeds | |
def q: X[String] = X("abc") | |
// succeeds | |
def r: X[Unit] = X("abc") | |
// fails | |
// def s: X[Unit] = q | |
// fails | |
// def t: X[Unit] = X[String]("abc") | |
// succeeds | |
def s: X[Unit] = X[Unit]("abc") | |
} |
retronym
commented
Sep 5, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment