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
Use simple name constructor in inner classes #2574
base: master
Are you sure you want to change the base?
Conversation
I manually built the jar to test it, and both the test case as well as the project the issue originally occurred in compile fine with my Eclipse now. Thank you! |
I'm not sure it solves the right problem. In general, having a non-static inner type where the outer type contains generics is asking for compiler problems. Maybe @rzwitserloot can share his experiences with this problem? |
Is there a case that is not covered by test cases? Information about inner classes + inner constructors + generics are quite rare and it seems like that even compilers disagree about how that should be handled 🤷♂️ |
For what it's worth: the bug this is addressing is a regression - the code that triggers the compiler error without this PR used to compile just fine a while ago. |
The problem is, I recently changed lombok to go from generating |
I added all this to fix issue #2268; this revert would mean 2268 is then broken again. We can debate two things:
But.. not for the next release, it'll have to wait. |
new Outer<String>.Inner<Integer>() -> new new Outer.Inner()
efb4c99
to
53705a1
Compare
@rzwitserloot Reworked the solution, it now uses raw types for the constructor call in eclipse/ecj. I also reverted the |
This PR fixes #2571.
Using
@With
in inner classes generates a constructor using the name of the outer and the inner class.ecj
does not like that if there also is a generic. To solve this lombok now generates constructor class using raw types:new Outer<T>.Inner<U>()
->new Outer.Inner()
.