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
scala 2.13.5> class C; class D extends C
scala 2.13.5> class Test { def foo: C = new C }
scala 2.13.5> class Test2 extends Test { override def foo = new D }
scala 2.13.5> (new Test2).foo
val res0: D = D@5d32c1c7
whereas in Scala 3 the type of res0 is C
I'm fairly sure this is intended behavior in Scala 3, but I can't seem to find either a ticket, or a migration guide entry about it.
There is a ticket complaining about the Scala 2 behavior: scala/bug#7212
The text was updated successfully, but these errors were encountered:
scala/scala-parser-combinators#370 isn't a compiler error, it's a runtime error. And I still don't really think either compiler's at fault, as it's just some crazy class casting code
whereas in Scala 3 the type of
res0
isC
I'm fairly sure this is intended behavior in Scala 3, but I can't seem to find either a ticket, or a migration guide entry about it.
There is a ticket complaining about the Scala 2 behavior: scala/bug#7212
The text was updated successfully, but these errors were encountered: