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

Projects

None yet

2 participants

@lombokissues
Collaborator

Migrated from Google Code (issue 343)

@lombokissues
Collaborator

👤 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
Collaborator

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

Checked a fix for this into master.

Will be in whatever follows 0.10.8.

@lombokissues lombokissues added this to the 0.10.9 milestone Jul 14, 2015
@lombokissues
Collaborator

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment