Minor, move old Java nullability assertion tests under oldLanguageVersions/
Also drop the (now confusing) "_lv12" suffix from newer tests
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
|
||||
// TARGET_BACKEND: JVM
|
||||
// FILE: test.kt
|
||||
// WITH_RUNTIME
|
||||
private operator fun A.inc() = A()
|
||||
|
||||
fun box(): String {
|
||||
var aNull = A.n()
|
||||
aNull++
|
||||
// NB no exception is thrown in language version 1.1
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
public class A {
|
||||
public static A n() { return null; }
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FILE: test.kt
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
operator fun A.inc() = A()
|
||||
|
||||
fun box(): String {
|
||||
assertFailsWith<IllegalArgumentException> {
|
||||
var aNull = A.n()
|
||||
aNull++
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
public class A {
|
||||
public static A n() { return null; }
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
// FILE: test.kt
|
||||
import kotlin.test.*
|
||||
|
||||
fun String.extension() {}
|
||||
|
||||
fun box(): String {
|
||||
assertFailsWith<IllegalArgumentException> { J.s().extension() }
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// FILE: J.java
|
||||
public class J {
|
||||
public static String s() { return null; }
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
// FILE: test.kt
|
||||
import kotlin.test.*
|
||||
|
||||
inline fun String.extension() {}
|
||||
|
||||
fun box(): String {
|
||||
J.s().extension() // NB no exception thrown
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// FILE: J.java
|
||||
public class J {
|
||||
public static String s() { return null; }
|
||||
}
|
||||
Reference in New Issue
Block a user