fix for for KT-259

This commit is contained in:
Alex Tkachman
2011-08-31 23:15:00 +02:00
parent ec31f991c0
commit 9e9959f953
3 changed files with 26 additions and 1 deletions
@@ -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");
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ public class TypeInfo<T> implements JetObject {
if (!theClass.isAssignableFrom(other.theClass)) {
return false;
}
if (nullable && !other.nullable) {
if (!nullable && other.nullable) {
return false;
}
if (typeParameters != null) {