FIR: Fix test data after making LHS of assignment an expression
KT-54648
This commit is contained in:
committed by
Space Team
parent
ace47c06a5
commit
1eb18f13bd
+24
@@ -0,0 +1,24 @@
|
||||
FILE: assignmentWithWrongLhs.kt
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(1)
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
R|/foo|() = Int(1)
|
||||
R|/foo|().R|kotlin/Int.toString|() = Int(1)
|
||||
when () {
|
||||
Boolean(true) -> {
|
||||
R|/foo|()
|
||||
}
|
||||
else -> {
|
||||
Int(1)
|
||||
}
|
||||
}
|
||||
= String()
|
||||
R|kotlin/run|<R|kotlin/Unit|>(<L> = run@fun <anonymous>(): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
R|kotlin/io/print|(String(To string)).R|kotlin/also|<R|kotlin/Unit|>(<L> = also@fun <anonymous>(it: R|kotlin/Unit|): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
R|kotlin/io/print|(R|<local>/it|)
|
||||
}
|
||||
)
|
||||
}
|
||||
) = Int(1)
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun foo(): Int = 1
|
||||
|
||||
fun test() {
|
||||
<!VARIABLE_EXPECTED!>foo()<!> = 1
|
||||
foo().<!VARIABLE_EXPECTED!>toString()<!> = <!ASSIGNMENT_TYPE_MISMATCH!>1<!>
|
||||
(<!VARIABLE_EXPECTED!>if (true) foo() else 1<!>) = <!ASSIGNMENT_TYPE_MISMATCH!>""<!>
|
||||
<!VARIABLE_EXPECTED!>run {
|
||||
print("To string").also { print(it) }
|
||||
}<!> = <!ASSIGNMENT_TYPE_MISMATCH!>1<!>
|
||||
}
|
||||
@@ -18,5 +18,5 @@ FILE: hashSet.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lvar c: R|kotlin/collections/MutableSet<kotlin/String>?| = Null(null)
|
||||
R|<local>/c| = R|java/util/HashSet.HashSet|<R|kotlin/String|>()
|
||||
R|<local>/c|!!.R|/d| = R|/produce|<R|kotlin/String?|>()
|
||||
R|<local>/c|!!.R|/d|<R|kotlin/String|> = R|/produce|<R|kotlin/String?|>()
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
FILE: listPlusAssign.kt
|
||||
public final fun R|kotlin/collections/List<kotlin/String>|.modify(): R|kotlin/Unit| {
|
||||
<Variable expected># = this@R|/modify|.R|kotlin/collections/plus|<R|kotlin/String|>(String(Alpha))
|
||||
<Variable expected># = this@R|/modify|.R|kotlin/collections/plus|<R|kotlin/String|>(String(Omega))
|
||||
this@R|/modify| = this@R|/modify|.R|kotlin/collections/plus|<R|kotlin/String|>(String(Alpha))
|
||||
this@R|/modify| = this@R|/modify|.R|kotlin/collections/plus|<R|kotlin/String|>(String(Omega))
|
||||
}
|
||||
public final fun R|kotlin/Any|.modify(): R|kotlin/Unit| {
|
||||
<Variable expected># = (this@R|/modify| as R|kotlin/collections/List<kotlin/Int>|).R|kotlin/collections/plus|<R|kotlin/Int|>(Int(42))
|
||||
(this@R|/modify| as R|kotlin/collections/List<kotlin/Int>|) = (this@R|/modify| as R|kotlin/collections/List<kotlin/Int>|).R|kotlin/collections/plus|<R|kotlin/Int|>(Int(42))
|
||||
}
|
||||
public final operator fun <T> R|kotlin/collections/Set<T>|.plusAssign(x: R|T|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// COMPARE_WITH_LIGHT_TREE
|
||||
|
||||
fun List<String>.modify() {
|
||||
<!VARIABLE_EXPECTED{PSI}!>this<!> += "Alpha"
|
||||
<!VARIABLE_EXPECTED{PSI}!>this<!> += "Omega"
|
||||
<!VARIABLE_EXPECTED!>this<!> += "Alpha"
|
||||
<!VARIABLE_EXPECTED!>this<!> += "Omega"
|
||||
}
|
||||
|
||||
fun Any.modify() {
|
||||
|
||||
Reference in New Issue
Block a user