8008337: Write test to check for compiler error when static method in interface is called via super()
Reviewed-by: mcimadamore
This commit is contained in:
parent
3c22954800
commit
96495bc664
26
langtools/test/tools/javac/lambda/StaticMethodNegTest.java
Normal file
26
langtools/test/tools/javac/lambda/StaticMethodNegTest.java
Normal file
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
StaticMethodNegTest.java:23:12: compiler.err.not.encl.class: A
|
||||
1 error
|
Loading…
Reference in New Issue
Block a user