[FIR] Adapt positioning of NO_VALUE_FOR_PARAMETER to match K1

This commit is contained in:
Kirill Rakhman
2023-06-23 13:05:49 +02:00
committed by Space Team
parent 6d1d6e48c1
commit 5abab2197b
42 changed files with 70 additions and 194 deletions
@@ -1,7 +1,7 @@
fun test1(f: String.() -> Unit) {
<!NO_VALUE_FOR_PARAMETER!>(f)()<!>
(f)<!NO_VALUE_FOR_PARAMETER!>()<!>
<!NO_VALUE_FOR_PARAMETER!>f()<!>
f<!NO_VALUE_FOR_PARAMETER!>()<!>
}
fun test2(f: (Int) -> Int) {
@@ -6,7 +6,7 @@ fun test1() {
fun test2(f: String.(Int) -> Unit) {
<!ARGUMENT_TYPE_MISMATCH!>11<!>.(f)(1)
11.<!NO_VALUE_FOR_PARAMETER!>(f)()<!>
11.(f)<!NO_VALUE_FOR_PARAMETER!>()<!>
}
fun test3() {
@@ -11,10 +11,10 @@ fun test(a: A) {
<!UNSAFE_IMPLICIT_INVOKE_CALL!>(a.x)<!>("")
with("") {
a.<!NO_VALUE_FOR_PARAMETER!>x()<!>
a.x<!NO_VALUE_FOR_PARAMETER!>()<!>
<!UNSAFE_IMPLICIT_INVOKE_CALL!>(a.x)<!>()
if (a.x != null) {
a.<!NO_VALUE_FOR_PARAMETER!>x()<!> // todo
a.x<!NO_VALUE_FOR_PARAMETER!>()<!> // todo
(a.x)()
}
}
@@ -23,8 +23,8 @@ fun test(a: A, b: B) {
}
with(b) {
a.<!NO_VALUE_FOR_PARAMETER!>foo()<!>
a.<!NO_VALUE_FOR_PARAMETER!>(foo)()<!>
a.foo<!NO_VALUE_FOR_PARAMETER!>()<!>
a.(foo)<!NO_VALUE_FOR_PARAMETER!>()<!>
(a.foo)()
@@ -65,8 +65,8 @@ fun test(a: A, b: B) {
}
with(b) {
a.<!NO_VALUE_FOR_PARAMETER!>foo()<!>
a.<!NO_VALUE_FOR_PARAMETER!>(foo)()<!>
a.foo<!NO_VALUE_FOR_PARAMETER!>()<!>
a.(foo)<!NO_VALUE_FOR_PARAMETER!>()<!>
(a.foo)()
@@ -1,17 +0,0 @@
class A {
val foo: B.() -> Unit get() = null!!
}
class B
fun test(a: A, b: B) {
with(b) {
a.<!NO_VALUE_FOR_PARAMETER!>foo()<!> // here must be error, because a is not extension receiver
a.foo(this)
(a.foo)()
(a.foo)(this)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class A {
val foo: B.() -> Unit get() = null!!
}