Created
March 30, 2015 15:30
-
-
Save Arneball/43c48e2bf2d4f4e88fbc 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
scala> :paste | |
// Entering paste mode (ctrl-D to finish) | |
trait Context | |
object Helper { | |
def stuff(implicit c: Context) = 3 | |
def stuff_=(i: Int)(implicit c: Context) = () | |
// woot | |
type C[_] = Context | |
def stuff2[T: C] = 3 | |
def stuff2_=[T: C](i: Int) = () | |
} | |
object Test { | |
implicit val c: Context = ??? | |
val s1 = Helper.stuff | |
Helper.stuff = 3 | |
val s2 = Helper.stuff2 | |
Helper.stuff2 = 3 | |
} | |
// Exiting paste mode, now interpreting. | |
<console>:23: error: reassignment to val | |
Helper.stuff2 = 3 | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment