Last active
December 15, 2015 19:49
-
-
Save tpolecat/5314444 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
object WAT extends App { | |
object Foo { | |
def !:(n: => Any) = "foo" | |
} | |
lazy val a = { println("AAA"); 1 } | |
lazy val b = { println("BBB"); 1 } | |
Foo.`!:`(a) // ok | |
b !: Foo // rewritten as { val x = b; Foo.`!:`(x) } | |
// per 6.12.3 and thus forces `b`, oops | |
} | |
// output is BBB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok so, for real? Is it actually impossible to write a nonstrict right-associative operator in Scala?