JVM: do not generate assertion message for captured fields
#KT-64615 Fixed
This commit is contained in:
committed by
Space Team
parent
f01e633f8b
commit
dd5fffebf2
+23
@@ -0,0 +1,23 @@
|
||||
// !LANGUAGE: +NoSourceCodeInNotNullAssertionExceptions
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM
|
||||
// FILE: test.kt
|
||||
fun f(x: String) = "Fail 1"
|
||||
|
||||
fun box(): String {
|
||||
return try {
|
||||
val variable = J().s()
|
||||
val block = { f(variable) }
|
||||
block()
|
||||
} catch (e: NullPointerException) {
|
||||
if (e.message == null)
|
||||
"OK"
|
||||
else
|
||||
"Fail: ${e.message}"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: J.java
|
||||
public class J {
|
||||
public final String s() { return null; }
|
||||
}
|
||||
Reference in New Issue
Block a user