You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-debate
Requiring the member selection to type check affects implicit conversions.
I'm not sure what I expected here:
scala> class C { def f = 42 } defined class C
scala> class D { def f_=(i: Int) = println(s"set $i") } defined class D
scala> class E defined class E
scala> implicit def cv(d: C): D = new D warning: there was one feature warning; re-run with -feature for details cv: (d: C)D
scala> (new C).f = 5 set 5 new C().f: Int = 42
scala> implicit def cv2(d: E): C = new C warning: there was one feature warning; re-run with -feature for details cv2: (d: E)C
scala> (new E).f = 5 <console>:16: error: value f_= is not a member of C (new E).f = 5 ^
Owen
unread,
Jul 6, 2016, 11:41:49 AM7/6/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-debate
Huh. That's really weird.
I suppose implicit conversions and mutability will always be a little odd together because implicit conversion naturally creates temporary objects that thwart mutable state.