aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorRawi01 <Rawi01@users.noreply.github.com>2022-10-30 10:18:07 +0100
committerRawi01 <Rawi01@users.noreply.github.com>2022-10-30 10:18:07 +0100
commitea14879df8492613f563b9130667ae3d0c3719e1 (patch)
tree89b6fdcbb6832c24bd035ee1ad9f740eabf2ce42 /src/core/lombok/javac
parent731bb185077918af8bc1e6a9e6bb538b2d3fbbd8 (diff)
downloadlombok-ea14879df8492613f563b9130667ae3d0c3719e1.tar.gz
lombok-ea14879df8492613f563b9130667ae3d0c3719e1.tar.bz2
lombok-ea14879df8492613f563b9130667ae3d0c3719e1.zip
[fixes #3242] Use real type for enclosing class
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/JavacResolution.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/lombok/javac/JavacResolution.java b/src/core/lombok/javac/JavacResolution.java
index f1109f4e..6ff6efe7 100644
--- a/src/core/lombok/javac/JavacResolution.java
+++ b/src/core/lombok/javac/JavacResolution.java
@@ -244,8 +244,15 @@ public class JavacResolution {
}
private void attrib(JCTree tree, Env<AttrContext> env) {
- if (env.enclClass.type == null) try {
- env.enclClass.type = Type.noType;
+ try {
+ if (env.enclClass.type == null) {
+ if (env.enclClass.sym != null) {
+ env.enclClass.type = env.enclClass.sym.type;
+ }
+ }
+ if (env.enclClass.type == null) {
+ env.enclClass.type = Type.noType;
+ }
} catch (Throwable ignore) {
// This addresses issue #1553 which involves JDK9; if it doesn't exist, we probably don't need to set it.
}