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
Change the definition of lub so that:
- lub(C, {Null, Nothing}) = C if C is a reference type
- lub(C, {Null, Nothing}) = Object if C is a value type (as before)
This allows us to generate more efficient code, and it better
matches the user's expectations.
erases to
instead of
def foo(x: String): Int = 100
.This is just an unintended consequence of erasedLub going up the class hierarchy (as opposed to the type hierarchy), where Null's parent is AnyRef and not String.
https://github.com/lampepfl/dotty/blob/master/compiler/src/dotty/tools/dotc/core/TypeErasure.scala#L286
It seems like we should special-case
Null
andNothing
inerasedLub
.The text was updated successfully, but these errors were encountered: