diff --git a/test/tools/javac/lambda/StaticMethodNegTest.java b/test/tools/javac/lambda/StaticMethodNegTest.java new file mode 100644 index 0000000000000000000000000000000000000000..2acfc84e44f2463e61c98de5c75a14479d159765 --- /dev/null +++ b/test/tools/javac/lambda/StaticMethodNegTest.java @@ -0,0 +1,26 @@ +/** + * @test /nodynamiccopyright/ + * @bug 8008337 + * @author sogoel + * @summary static method is called via super + * @compile/fail/ref=StaticMethodNegTest.out -XDrawDiagnostics StaticMethodNegTest.java + */ + +interface A { + static String m() { + return "A"; + } +} + +interface B { + static String m() { + return "B"; + } +} + +interface AB extends A, B { + static String m() { + return A.super.m(); + } +} + diff --git a/test/tools/javac/lambda/StaticMethodNegTest.out b/test/tools/javac/lambda/StaticMethodNegTest.out new file mode 100644 index 0000000000000000000000000000000000000000..6e2258e3899b0f8c8071b43ca642c64f6105f793 --- /dev/null +++ b/test/tools/javac/lambda/StaticMethodNegTest.out @@ -0,0 +1,2 @@ +StaticMethodNegTest.java:23:12: compiler.err.not.encl.class: A +1 error