Files
kotlin/compiler/testData/codegen/boxAgainstJava/oldLanguageVersions/ieee754/explicitEqualsCallNull.kt
Alexander Udalov 9c9e13d93e Minor, move obsolete test to oldLanguageVersions
Ignore this directory in JVM IR boxAgainstJava tests (similarly to box
tests) so that we can ignore the fact that this test doesn't pass in
JVM_IR, since it shouldn't.
2020-02-12 17:36:08 +01:00

32 lines
572 B
Kotlin
Vendored

// !LANGUAGE: -ThrowNpeOnExplicitEqualsForBoxedNull
// IGNORE_BACKEND: JVM_IR
// ^ ThrowNpeOnExplicitEqualsForBoxedNull is introduced in 1.2.
// FILE: JavaClass.java
public class JavaClass {
public Double minus0(){
return -0.0;
}
public Double plus0(){
return 0.0;
}
public Double null0(){
return null;
}
}
// FILE: b.kt
fun box(): String {
val jClass = JavaClass()
if (jClass.null0().equals(jClass.plus0())) return "fail 6"
if (jClass.minus0().equals(jClass.null0())) return "fail 7"
return "OK"
}