mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 14:16:11 +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;
|
||||
}
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user