check to prevent contradicted intersection type (IDEA-67600)

This commit is contained in:
Anna Kozlova
2014-06-09 17:03:12 +04:00
parent 046b90c352
commit 27f10a6c30
3 changed files with 31 additions and 1 deletions
@@ -0,0 +1,24 @@
abstract class A<T, S extends T>
{
abstract S bar();
void foo(A<Runnable[], ? extends Cloneable[]> a){
<error descr="Incompatible types. Found: 'java.lang.Cloneable[]', required: 'java.lang.Runnable[]'">Runnable[] x = a.bar();</error>
}
}
abstract class AB<T, S extends T>
{
abstract S bar();
void foo(AB<Runnable, ? extends Cloneable> a){
Runnable x = a.bar();
}
}
abstract class AC<T, S>
{
abstract S bar();
void foo(AC<Runnable[], ? extends Cloneable[]> a){
<error descr="Incompatible types. Found: 'java.lang.Cloneable[]', required: 'java.lang.Runnable[]'">Runnable[] x = a.bar();</error>
}
}