[fixes #3242] Use real type for enclosing class

This commit is contained in:
Rawi01 committed 2022-10-30 10:18:07 +01:00
1 parent 731bb18507
commit ea14879df8
4 files changed
+51 -2

No files matched your search

+9 -2
View File
@@ -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.
}
@@ -0,0 +1,12 @@
// version :9
class ValSuperDefaultMethod implements Default {
public void test() {
final java.lang.String a = "";
Default.super.method();
}
}
interface Default {
default void method() {
}
}
@@ -0,0 +1,14 @@
import lombok.val;
class ValSuperDefaultMethod implements Default {
ValSuperDefaultMethod() {
super();
}
public void test() {
final @val java.lang.String a = "";
Default.super.method();
}
}
interface Default {
default void method() {
}
}
@@ -0,0 +1,16 @@
// version :9
import lombok.val;
class ValSuperDefaultMethod implements Default {
public void test() {
val a = "";
Default.super.method();
}
}
interface Default {
default void method() {
}
}