-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
improvements type inference of type intersections (affects ValLambda.java, ValWeirdTypes.java tests) #2109
improvements type inference of type intersections (affects ValLambda.java, ValWeirdTypes.java tests) #2109
Conversation
…java, ValWeirdTypes.java tests)
Unfortunately, looks like I have to shoot this one down. I don't know how you do it, but you manage to make javac (with lombok with your patch) correctly untangle this marvellous line of code: lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; If I try to compile that with javac with lombok with your patch in it, it works. But if I try to compile the same thing with ecj, it won't (it can't target-type Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; and this won't compile on either: Object foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; adding to the impressiveness of the patch :) Nevertheless, if we can't make ecj and javac do the same thing here, I prefer to just call it a day and go with j.l.Object for this stuff. Not great either, but at least consistent. |
…avac, when using ‘val’ on an intersection type." This reverts commit 1730a99
…m/bulgakovalexander/lombok into feature/typeInferenceImprovements
…rget type of this expression must be a functional interface' in code like 'lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println;'
This is some seriously impressive voodoo magic, Alex! Will be in the next release :) |
See also 2eab72c |
No description provided.