aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-04-24 13:52:49 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-04-24 13:52:49 +0200
commit1730a991b50439f91bba217bb49edc860915ee70 (patch)
tree9d34bd4cff86fa1efa88258f5e43f3e5822b5f5c
parentccaefff69fc021048ac6918948a0cae29e045b76 (diff)
downloadlombok-1730a991b50439f91bba217bb49edc860915ee70.tar.gz
lombok-1730a991b50439f91bba217bb49edc860915ee70.tar.bz2
lombok-1730a991b50439f91bba217bb49edc860915ee70.zip
[val] in ecj we were constructing a different type than for javac, when using ‘val’ on an intersection type.
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchVal.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
index 12f4ad3d..b32c99cd 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
@@ -263,11 +263,15 @@ public class PatchVal {
resolved = null;
}
if (resolved != null) {
- try {
- replacement = makeType(resolved, local.type, false);
- if (!decomponent) init.resolvedType = replacement.resolveType(scope);
- } catch (Exception e) {
- // Some type thing failed.
+ if (resolved.getClass().getSimpleName().startsWith("IntersectionTypeBinding")) {
+ // We intentionally deconstruct these into simply 'Object', because picking an arbitrary type amongst the intersection feels worse.
+ } else {
+ try {
+ replacement = makeType(resolved, local.type, false);
+ if (!decomponent) init.resolvedType = replacement.resolveType(scope);
+ } catch (Exception e) {
+ // Some type thing failed.
+ }
}
}
}