mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-16 00:15:01 +00:00
Merge pull request #3288 from Rawi01/val-default-method
Use real type for enclosing class
This commit is contained in:
4 files changed
+51
-2
No files matched your search
@@ -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() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user