[FIR] Don't report MUST_BE_INITIALIZED* on unreachable properties

This commit is contained in:
Andrey Zinovyev
2021-05-11 13:12:02 +03:00
committed by TeamCityServer
parent 8308f5d7d3
commit 84a7bdffe5
3 changed files with 87 additions and 15 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED
// WITH_RUNTIME
@@ -12,10 +11,49 @@ class C {
var uninitializedVar: String
}
fun box(): String =
class Foo {
init {
TODO()
}
val uninitializedVal: String
var uninitializedVar: String
}
class Bar {
val initializedVal = 43
init {
TODO()
}
val uninitializedVal: String
var uninitializedVar: String
}
fun box(): String {
try {
C()
"Fail"
return "Fail"
} catch (e: NotImplementedError) {
"OK"
//OK
}
try {
Foo()
return "Fail"
} catch (e: NotImplementedError) {
//OK
}
try {
Bar()
return "Fail"
} catch (e: NotImplementedError) {
//OK
}
return "OK"
}