mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
diamonds inference: test data just-in-case
This commit is contained in:
+25
-1
@@ -42,4 +42,28 @@ class Test1 {
|
||||
}
|
||||
|
||||
class FF<X> extends F<X>{}
|
||||
class F<T> {}
|
||||
class F<T> {}
|
||||
|
||||
class MyTest {
|
||||
static class Foo<X> {
|
||||
Foo(X x) {}
|
||||
}
|
||||
|
||||
static interface Base<Y> {}
|
||||
static class A extends Exception implements Base<String> {}
|
||||
static class B extends Exception implements Base<Integer> {}
|
||||
|
||||
void m() throws B {
|
||||
try {
|
||||
if (true) {
|
||||
throw new A();
|
||||
}
|
||||
else {
|
||||
throw new B();
|
||||
}
|
||||
} catch (A ex) {
|
||||
Foo<? extends Base<String>> foo1 = new Foo<>(ex); // ok
|
||||
<error descr="Incompatible types. Found: 'MyTest.Foo<MyTest.A>', required: 'MyTest.Foo<MyTest.Base<java.lang.String>>'">Foo<Base<String>> foo2 = new Foo<>(ex);</error> // should be error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user