mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 14:16:39 +00:00
[val] in ecj we were constructing a different type than for javac, when using ‘val’ on an intersection type.
This commit is contained in:
1 parent
ccaefff69f
commit
1730a991b5
1 file changed
+9
-5
@@ -263,11 +263,15 @@ public class PatchVal {
|
|||||||
resolved = null;
|
resolved = null;
|
||||||
}
|
}
|
||||||
if (resolved != null) {
|
if (resolved != null) {
|
||||||
try {
|
if (resolved.getClass().getSimpleName().startsWith("IntersectionTypeBinding")) {
|
||||||
replacement = makeType(resolved, local.type, false);
|
// We intentionally deconstruct these into simply 'Object', because picking an arbitrary type amongst the intersection feels worse.
|
||||||
if (!decomponent) init.resolvedType = replacement.resolveType(scope);
|
} else {
|
||||||
} catch (Exception e) {
|
try {
|
||||||
// Some type thing failed.
|
replacement = makeType(resolved, local.type, false);
|
||||||
|
if (!decomponent) init.resolvedType = replacement.resolveType(scope);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Some type thing failed.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user