-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ConditionalExpr resolves to wrong type #1743
Comments
The current implementation is wrong and the rules for implementing it correctly are far from trivial. There is a pretty significant part of the JLS discussing about this: https://docs.oracle.com/javase/specs/jls/se10/html/jls-15.html#jls-15.25 |
Reference conditional expression refer to #2978 |
Partially fix the issue #1743 ConditionalExpr resolves to wrong type
This issue is resolved but we have to manage case of conditional reference expression and poly expression. |
Poly expression is resolved with PR #2994 |
Partially fix issue #1743 ConditionalExpr resolves to wrong type - tr…
TODO manage lub function (in TypeHelper.leastUpperBound) and update TypeExtractor.visit(ConditionalExpr node, Boolean solveLambdas) to manage reference conditional expression. |
Resolved in PR #3880 |
The type solver always resolves conditional expressions to the type of the then part, which makes e.g.
s == null ? null : s.toString()
surprisingly being resolved to the null type instead of String.The text was updated successfully, but these errors were encountered: