FIR: fix a bunch of issues after DiagnosticsReporter refactoring related to reporting diagnostic on null source

This commit is contained in:
Kirill Rakhman
2023-01-05 15:00:30 +01:00
committed by Space Team
parent a7edf5b83e
commit 69f2e8826a
27 changed files with 74 additions and 42 deletions
@@ -1,6 +1,8 @@
// IGNORE_BACKEND: JS, JS_IR, NATIVE, WASM
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND_K2: JVM_IR
// WASM_MUTE_REASON: IGNORED_IN_JS
// FIR status: don't support legacy feature. UNINITIALIZED_PARAMETER y. See KT-49800
fun f(
f1: () -> String = { f2() },
@@ -14,7 +14,7 @@ fun test_2(
) {}
fun test_3(
x: () -> Any = { y() to <!UNINITIALIZED_PARAMETER!>y<!>.invoke() }, // Error
x: () -> Any = { <!UNINITIALIZED_PARAMETER!>y<!>() to <!UNINITIALIZED_PARAMETER!>y<!>.invoke() }, // Error
y: () -> String = { "OK" }
) {}
@@ -14,7 +14,7 @@ fun test_2(
) {}
fun test_3(
x: () -> Any = { y() to <!UNINITIALIZED_PARAMETER!>y<!>.invoke() }, // Error
x: () -> Any = { <!UNINITIALIZED_PARAMETER!>y<!>() to <!UNINITIALIZED_PARAMETER!>y<!>.invoke() }, // Error
y: () -> String = { "OK" }
) {}
@@ -85,7 +85,7 @@ object O {
operator fun provideDelegate(x: Any?, y: Any?): C = C()
}
val x: String by <!OPT_IN_USAGE_ERROR!>O<!>
val x: String by <!OPT_IN_USAGE_ERROR, OPT_IN_USAGE_ERROR!>O<!>
@Marker
class OperatorContainer : Comparable<OperatorContainer> {
@@ -122,4 +122,4 @@ fun operatorContainerUsage(s: String, a: AnotherContainer) {
val res2 = <!OPT_IN_USAGE_ERROR!>s<!>()
val res3 = <!OPT_IN_USAGE_ERROR!>res1<!> <!OPT_IN_USAGE_ERROR!>><!> <!OPT_IN_USAGE_ERROR!>res2<!>
<!OPT_IN_USAGE_ERROR, OPT_IN_USAGE_ERROR, OPT_IN_USAGE_ERROR, OPT_IN_USAGE_ERROR, OPT_IN_USAGE_ERROR!>for (c in a) {}<!>
}
}
@@ -85,7 +85,7 @@ object O {
operator fun provideDelegate(x: Any?, y: Any?): C = C()
}
val x: String by <!OPT_IN_USAGE_ERROR!>O<!>
val x: String by <!OPT_IN_USAGE_ERROR, OPT_IN_USAGE_ERROR!>O<!>
@Marker
class OperatorContainer : Comparable<OperatorContainer> {
@@ -1,3 +1,6 @@
// IGNORE_BACKEND_K2: ANY
// accessing uninitialized parameter is illegal in FIR
fun f(
f1: () -> String = { f2() },
f2: () -> String = { "FAIL" }