Skip to content
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

Invalid expansion of lombok.val for Map.Entry containing an inner class of a generic outer class #416

Closed
lombokissues opened this issue Jul 14, 2015 · 3 comments
Assignees
Milestone

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 343)

@lombokissues
Copy link
Author

👤 jwnimmer@jaybridge.com   🕗 Feb 07, 2012 at 15:28 UTC

What steps will reproduce the problem?

  1. Use lombok.val to iterate over a map with a inner class of a generic outer;
    a sample file is inlined here:

package pkg;
import java.util.Map;
public class Thing<T> {
private final Map<String, Outer<T>.Inner> map = null;
private void loop() {
for (lombok.val entry : map.entrySet()) {}
}
}
class Outer<T> { class Inner {} }

What is the expected output? What do you see instead?

Eclipse and delombok both produce an invalid substitute type for val.
Delombok produces the for-loop as:

for (final java.util.Map.Entry<java.lang.String, pkg.Outer.Inner> entry :
map.entrySet()) { }

Eclipse says: Type mismatch: cannot convert from element type
Map.Entry<String,Outer<T>.Inner> to Map.Entry<String,Outer.Inner>

I expect second the Map.Entry generic parameters to show up as
pkg.Outer<T>.Inner, not pkg.Outer.Inner.

What version of the product are you using? On what operating system?
Eclipse SDK Version: 3.7.1 Build id: M20110909-1335
Lombok v0.10.8 "Burning Emu" is installed. https://projectlombok.org/
java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.10) (6b20-1.9.10-0ubuntu1~10.04.3)

@lombokissues
Copy link
Author

👤 reinierz   🕗 Feb 14, 2012 at 17:20 UTC

Checked a fix for this into master.

Will be in whatever follows 0.10.8.

@lombokissues
Copy link
Author

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants