fix for for KT-259
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
class A() {}
|
||||||
|
class B<T>() {}
|
||||||
|
|
||||||
|
fun box() : String {
|
||||||
|
val a = A()
|
||||||
|
System.out?.println(a is A) //true
|
||||||
|
System.out?.println(a is A?) //true
|
||||||
|
|
||||||
|
val b = B<String>()
|
||||||
|
System.out?.println(b is B<String>) //true
|
||||||
|
System.out?.println(b is B<String>?) //false !!!
|
||||||
|
|
||||||
|
val v = b as B<String> //ok
|
||||||
|
val u = b as B<String>? //TypeCastException
|
||||||
|
|
||||||
|
val w : B<String>? = b as B<String> //ok
|
||||||
|
val x = w as B<String>? //TypeCastException
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
@@ -128,5 +128,10 @@ public class TypeInfoTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKt259() throws Exception {
|
||||||
|
blackBoxFile("regressions/kt259.jet");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class TypeInfo<T> implements JetObject {
|
|||||||
if (!theClass.isAssignableFrom(other.theClass)) {
|
if (!theClass.isAssignableFrom(other.theClass)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (nullable && !other.nullable) {
|
if (!nullable && other.nullable) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (typeParameters != null) {
|
if (typeParameters != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user