Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.