mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
8047407: Add test for JDK-8037385
Reviewed-by: mcimadamore
This commit is contained in:
parent
06b8a7ac80
commit
fe46aeabb0
3 changed files with 21 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
/* @test /nodynamiccopyright/
|
||||
* @bug 8037385
|
||||
* @summary Must not allow static interface method invocation in legacy code
|
||||
* @compile -source 8 -Xlint:-options StaticInvoke.java
|
||||
* @compile/fail/ref=StaticInvoke7.out -source 7 -Xlint:-options -XDrawDiagnostics StaticInvoke.java
|
||||
* @compile/fail/ref=StaticInvoke6.out -source 6 -Xlint:-options -XDrawDiagnostics StaticInvoke.java
|
||||
*/
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class StaticInvoke {
|
||||
void test() {
|
||||
Stream.empty();
|
||||
java.util.stream.Stream.empty();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
StaticInvoke.java:12:15: compiler.err.static.intf.method.invoke.not.supported.in.source: 1.6
|
||||
StaticInvoke.java:13:32: compiler.err.static.intf.method.invoke.not.supported.in.source: 1.6
|
||||
2 errors
|
|
@ -0,0 +1,3 @@
|
|||
StaticInvoke.java:12:15: compiler.err.static.intf.method.invoke.not.supported.in.source: 1.7
|
||||
StaticInvoke.java:13:32: compiler.err.static.intf.method.invoke.not.supported.in.source: 1.7
|
||||
2 errors
|
Loading…
Add table
Add a link
Reference in a new issue