8008337: Write test to check for compiler error when static method in interface is called via super()
authormcimadamore
Fri, 22 Feb 2013 13:31:35 +0000
changeset 16317 1b4b06b67ea4
parent 16316 1150b1b2f5c2
child 16318 14906f8d3a42
8008337: Write test to check for compiler error when static method in interface is called via super() Reviewed-by: mcimadamore Contributed-by: sonali.goel@oracle.com
langtools/test/tools/javac/lambda/StaticMethodNegTest.java
langtools/test/tools/javac/lambda/StaticMethodNegTest.out
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/StaticMethodNegTest.java	Fri Feb 22 13:31:35 2013 +0000
@@ -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();
+ }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/StaticMethodNegTest.out	Fri Feb 22 13:31:35 2013 +0000
@@ -0,0 +1,2 @@
+StaticMethodNegTest.java:23:12: compiler.err.not.encl.class: A
+1 error