mirror of
https://github.com/tiennm99/lombok.git
synced 2026-08-21 08:26:37 +00:00
[fixes #2420] Copy vartype.type
This commit is contained in:
@@ -109,6 +109,8 @@ public class TreeMirrorMaker extends TreeCopier<Void> {
|
||||
if (wipeSymAndType) {
|
||||
copy.sym = null;
|
||||
copy.type = null;
|
||||
} else {
|
||||
if (original.vartype != null) copy.vartype.type = original.vartype.type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
public class ValAnonymousSubclassSelfReference {
|
||||
public void test() {
|
||||
int i = 0;
|
||||
final int j = 1;
|
||||
final int k = 2;
|
||||
new ValAnonymousSubclassSelfReference() {
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import lombok.val;
|
||||
public class ValAnonymousSubclassSelfReference {
|
||||
public ValAnonymousSubclassSelfReference() {
|
||||
super();
|
||||
}
|
||||
public void test() {
|
||||
int i = 0;
|
||||
final @val int j = 1;
|
||||
final @val int k = 2;
|
||||
new ValAnonymousSubclassSelfReference() {
|
||||
x() {
|
||||
super();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// issue 2420: to trigger the problem 2 var/val, one normal variable and a anonymous self reference is required
|
||||
import lombok.val;
|
||||
|
||||
public class ValAnonymousSubclassSelfReference {
|
||||
public void test() {
|
||||
int i = 0;
|
||||
val j = 1;
|
||||
val k = 2;
|
||||
|
||||
new ValAnonymousSubclassSelfReference() { };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user