-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix override containing type param in explicit nulls #13975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix override containing type param in explicit nulls #13975
Conversation
1c56c9d to
9445d16
Compare
odersky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it not very appealing to run a deep type map on types for a performance critical method like matches. Is there no better/faster way to achieve what we want? Maybe a change to matches in TypeComparer?
23a52e7 to
10f13ea
Compare
10f13ea to
247c6da
Compare
|
In source file instead of |
6bb73a5 to
939ec21
Compare
odersky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM!
If a member signature contains type parameters when overriding a Java class, the check will still fail even if we retract
SafeNullsfrom the ctx, becauseT | Nullis not a subtype ofT.This fix will use a more relaxed approach by forcing
Nullbeing a bottom type during overriding check.A type varibale
Tfrom Java is translated toT >: Nothing <: Any. However,nullcan always be a value ofTfor Java side. So the best solution here is to letNullbe a subtype of non-primitive value types temporarily.Example: