-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
@EqualsAndHashCode on inner class produces invalid cast #362
Comments
👤 [email protected] 🕗 Oct 18, 2011 at 18:30 UTC What steps will reproduce the problem? A lombok-generated equals method has problems with instanceof vs type erasure of an outer class. $ cat Bug.java public class Bug<T> { $ java -jar lombok.jar delombok -d delombok Bug.java; cat delombok/Bug.java // Generated by delombok at Tue Oct 18 14:22:08 EDT 2011
} $ javac -classpath lombok.jar delombok/Bug.java delombok/Bug.java:14: illegal generic type for instanceof $ java -jar ecj.jar -source 1.6 delombok/Bug.java
What version of the product are you using? On what operating system? Lombok version: 0.10.1-EDGE 2011-09-20 18:50 UTC Please provide any additional information below. The fix suggested by ECJ is s/Inner/Bug.Inner/ on instanceof, as in: |
👤 [email protected] 🕗 Oct 18, 2011 at 18:39 UTC Two more notes:
|
👤 pe.fips 🕗 Oct 19, 2011 at 21:53 UTC Good find! |
👤 reinierz 🕗 Oct 25, 2011 at 13:06 UTC Very good find. I'd make the case that this is a javac bug, actually, but ecj agrees with javac, so, maybe it's just a boneheaded part of the spec. Nevertheless, we can fix this by always fully specifying the full chain (Outer.Inner.Innerer.Innermost). Seems easy enough. |
👤 reinierz 🕗 Oct 25, 2011 at 17:39 UTC Fixed in 16661be for both eclipse and javac (it was broken in both). |
End of migration |
Migrated from Google Code (issue 289)
The text was updated successfully, but these errors were encountered: