Add test for KT-41254
It was fixed along with #KT-41005
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class Inv<T>(val x: T?)
|
||||
|
||||
fun <R> foo(f: () -> R?): Inv<R> {
|
||||
val r = f()
|
||||
if (r != null) throw Exception("fail, result is not null: $r")
|
||||
return Inv(r)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val r: Inv<Unit> = foo { if (false) Unit else null }
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user