Commit 6d9327a7 authored by Anna.Kozlova's avatar Anna.Kozlova
Browse files

lvti: additional test data for projections

parent 3ef146e3
Showing with 16 additions and 3 deletions
+16 -3
......@@ -34,13 +34,26 @@ class Main {
e[0].add<error descr="'add(capture<? extends java.lang.String>)' in 'X' cannot be applied to '(java.lang.String)'">("")</error>;
}
void fooHierarchy(X<? extends B, A> x) {
var y = x;
y = new X<B, A>();
y = new X<C, A>();
A a = y.get();
B b = y.get();
<error descr="Incompatible types. Found: 'capture<? extends B>', required: 'C'">C c = y.get();</error>
}
<M> M[] m(M m) {
return null;
}
}
abstract class X<T extends S, S> {
abstract T get();
abstract void add(T t);
class A {}
class B extends A {}
class C extends B {}
class X<T extends S, S> {
T get() {return null;}
void add(T t) {}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment