You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classC[A<:AnyRef] { vala:A=null.asInstanceOf[A] ; deff(x: A) = x match { case_: a.type=>42 } }
classD[A] { vala:A=null.asInstanceOf[A] ; deff(x: A) = x match { case_: a.type=>42 } }
Output
scala>classC[A] { vala:A=null.asInstanceOf[A] ; deff(x: A) = x match { case_: a.type=>42 } }
// defined class C
scala>classC[A<:AnyRef] { vala:A=null.asInstanceOf[A] ; deff(x: A) = x match { case_: a.type=>42 } }
// defined class C
Expectation
scala 2.13.8>classC[A] { vala:A=null.asInstanceOf[A] ; deff(x: A) = x match { case_: a.type=>42 } }
^warning: abstracttypepatternA (the underlying of C.this.a.type) is unchecked since it is eliminated by erasure
classC
Some sort of messaging that my singleton type pattern is not kosher and will not be checked with eq.
With the upper bound, eq is used as expected. That is the same behavior as Scala 2, which murmurs about it.
Compiler version
3.1.3-RC1
Minimized code
Output
Expectation
Some sort of messaging that my singleton type pattern is not kosher and will not be checked with
eq
.With the upper bound,
eq
is used as expected. That is the same behavior as Scala 2, which murmurs about it.Forward port of scala/bug#12569
The text was updated successfully, but these errors were encountered: