mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-05 21:00:59 +07:00
split tests according to expected language level
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
interface OfInt extends Sink<Integer> {
|
||||
default void accept(Integer i) {}
|
||||
}
|
||||
interface Sink<T> extends Block<T> {
|
||||
}
|
||||
|
||||
interface Block<T> {
|
||||
public void accept(T t);
|
||||
}
|
||||
|
||||
|
||||
class Hello1 implements Sink<Integer>, OfInt {}
|
||||
class Hello2 implements OfInt, Sink<Integer>{}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
interface I {
|
||||
void m1() <error descr="Deprecated extension method syntax">default</error> { }
|
||||
|
||||
default void m2() <error descr="Deprecated extension method syntax">default</error> { }
|
||||
|
||||
@SuppressWarnings("extensionSyntax")
|
||||
void m3() default { }
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class C {
|
||||
interface I {
|
||||
int i = 42;
|
||||
void m() default { }
|
||||
}
|
||||
|
||||
interface II extends I {
|
||||
void m() default {
|
||||
I.super.m();
|
||||
<error descr="Unqualified super reference is not allowed in extension method">super.m</error>();
|
||||
|
||||
System.out.println(I.super.i);
|
||||
System.out.println<error descr="Cannot resolve method 'println(?)'">(<error descr="Unqualified super reference is not allowed in extension method">super.i</error>)</error>;
|
||||
}
|
||||
|
||||
void ma();
|
||||
}
|
||||
|
||||
void test() {
|
||||
new I(){}.m();
|
||||
|
||||
new II() {
|
||||
public void ma() {
|
||||
<error descr="'C.I' is not an enclosing class">I.super</error>.m();
|
||||
II.super.m();
|
||||
<error descr="Abstract method 'ma()' cannot be accessed directly">II.super.ma()</error>;
|
||||
}
|
||||
}.m();
|
||||
}
|
||||
}
|
||||
|
||||
class D {
|
||||
<error descr="Extension methods can only be used within an interface">void m()</error> default { }
|
||||
}
|
||||
|
||||
interface IllegalMods {
|
||||
<error descr="Static methods in interfaces should have a body">static void m1()</error>;
|
||||
<error descr="Illegal combination of modifiers: 'static' and 'default'">static</error> void m2() default { }
|
||||
<error descr="Illegal combination of modifiers: 'static' and 'default'">static</error> <error descr="Illegal combination of modifiers: 'default' and 'static'">default</error> void m3() { }
|
||||
|
||||
<error descr="Illegal combination of modifiers: 'abstract' and 'default'">abstract</error> void m4() default { }
|
||||
<error descr="Illegal combination of modifiers: 'abstract' and 'default'">abstract</error> <error descr="Illegal combination of modifiers: 'default' and 'abstract'">default</error> void m5() { }
|
||||
|
||||
<error descr="Extension method should have a body">default void m6()</error>;
|
||||
|
||||
<error descr="Modifier 'default' not allowed here">default</error> int i;
|
||||
<error descr="Modifier 'default' not allowed here">default</error> interface X { }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
interface B { default void foo() {} }
|
||||
interface C { default void foo() {} }
|
||||
class <error descr="D inherits unrelated defaults for foo() from types B and C">D</error> implements B, C {}
|
||||
@@ -0,0 +1,15 @@
|
||||
interface FirstParent {
|
||||
|
||||
default int doSomething() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
interface SecondParent {
|
||||
|
||||
int doSomething();
|
||||
}
|
||||
|
||||
class <error descr="Class 'SecondParent' must either be declared abstract or implement abstract method 'doSomething()' in 'SecondParent'">FirstSon</error> implements FirstParent, SecondParent {}
|
||||
|
||||
<error descr="Class 'SecondSon' must either be declared abstract or implement abstract method 'doSomething()' in 'SecondParent'">class SecondSon implements SecondParent, FirstParent</error> {}
|
||||
Reference in New Issue
Block a user