Added regression tests for KT-3518 Null pointer during null comparison in JS Backend.

This commit is contained in:
Zalim Bashorov
2014-10-21 19:28:17 +04:00
parent 2e3c0505cd
commit f3d9d21757
2 changed files with 18 additions and 0 deletions
@@ -49,4 +49,8 @@ public final class EqualsTest extends AbstractExpressionTest {
public void testEqualsNullOrUndefined() throws Exception {
checkFooBoxIsOk();
}
public void testCompareNullableListWithNull() throws Exception {
checkFooBoxIsOk();
}
}
@@ -0,0 +1,14 @@
// KT-3518 Null pointer during null comparison in JS Backend
package foo
class MyClazz(val nullableL : List<String>?)
fun box(): String {
val a = MyClazz(null)
if(a.nullableL != null) return "a.nullableL != null"
val b = MyClazz(listOf("somthing"))
if(b.nullableL == null) return "b.nullableL == null"
return "OK"
}