From ea14879df8492613f563b9130667ae3d0c3719e1 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sun, 30 Oct 2022 10:18:07 +0100 Subject: [fixes #3242] Use real type for enclosing class --- src/core/lombok/javac/JavacResolution.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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 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. } -- cgit