Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/notNullAssertions/extensionReceiverParameter.kt
T
Mikhail Zarechenskiy 5c5635ce20 Fix codegen & bytecode tests after unifying exceptions in JVM backend
See KT-22275 for details
2020-01-20 16:36:03 +03:00

33 lines
594 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FILE: Test.java
public class Test {
public static String invokeFoo() {
try {
ExtensionKt.foo(null);
}
catch (NullPointerException e) {
try {
ExtensionKt.getBar(null);
}
catch (NullPointerException f) {
return "OK";
}
}
return "Fail: assertion must have been fired";
}
}
// FILE: extension.kt
fun Any.foo() { }
val Any.bar: String get() = ""
fun box(): String {
return Test.invokeFoo()
}