Added regression tests for KT-3518 Null pointer during null comparison in JS Backend.
This commit is contained in:
@@ -49,4 +49,8 @@ public final class EqualsTest extends AbstractExpressionTest {
|
|||||||
public void testEqualsNullOrUndefined() throws Exception {
|
public void testEqualsNullOrUndefined() throws Exception {
|
||||||
checkFooBoxIsOk();
|
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"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user