bug icon indicating copy to clipboard operation
bug copied to clipboard

Singleton types are lost when used on the left of a right-associative operator

Open xuwei-k opened this issue 7 years ago • 1 comments
trafficstars

Welcome to Scala 2.13.0-pre-1f68c6c (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_181).
Type in expressions for evaluation. Or try :help.

scala> class A[B](val b: B) { def c: List[b.type] = List(b) }
defined class A

scala> class A[B](val b: B) { def c: List[b.type] = b :: Nil }
                                                    ^
       error: type mismatch;
        found   : rassoc$1.type (with underlying type B)
        required: A.this.b.type

https://github.com/scala/bug/issues/10726#issuecomment-415036293

xuwei-k avatar Aug 28 '18 05:08 xuwei-k

I conservatively assigned to 2.14, since this is likely tricky to fix and we're running out of time for 2.13.

adriaanm avatar Jan 08 '19 12:01 adriaanm