[FIR] Generate dispatch & extension receivers for variable assignments
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FILE: main.kt
|
FILE: main.kt
|
||||||
public final fun test(b: R|B|): R|kotlin/Unit| {
|
public final fun test(b: R|B|): R|kotlin/Unit| {
|
||||||
R|/B.text| = R|<local>/b|.R|/B.text|.R|kotlin/String.plus|(String())
|
R|<local>/b|.R|/B.text| = R|<local>/b|.R|/B.text|.R|kotlin/String.plus|(String())
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -290,6 +290,10 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
|
|||||||
source = operatorCall.argument.source
|
source = operatorCall.argument.source
|
||||||
diagnostic = ConeVariableExpectedError()
|
diagnostic = ConeVariableExpectedError()
|
||||||
}
|
}
|
||||||
|
(leftArgument as? FirQualifiedAccess)?.let {
|
||||||
|
dispatchReceiver = it.dispatchReceiver
|
||||||
|
extensionReceiver = it.extensionReceiver
|
||||||
|
}
|
||||||
}
|
}
|
||||||
assignment.transform(transformer, ResolutionMode.ContextIndependent)
|
assignment.transform(transformer, ResolutionMode.ContextIndependent)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class A(var value: String)
|
class A(var value: String)
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class A(var value: String)
|
class A(var value: String)
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class A(var value: String)
|
class A(var value: String)
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
data class A(var x: Int, var y: String)
|
data class A(var x: Int, var y: String)
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
object Test {
|
object Test {
|
||||||
var z = "0"
|
var z = "0"
|
||||||
var l = 0L
|
var l = 0L
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
var z = "0"
|
var z = "0"
|
||||||
var l = 0L
|
var l = 0L
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class MyString {
|
class MyString {
|
||||||
var s = ""
|
var s = ""
|
||||||
operator fun plus(x : String) : MyString {
|
operator fun plus(x : String) : MyString {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class MyString {
|
class MyString {
|
||||||
var s = ""
|
var s = ""
|
||||||
operator fun plus(x : String) : MyString {
|
operator fun plus(x : String) : MyString {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
//KT-3869 Loops and finally: outer finally block not run
|
//KT-3869 Loops and finally: outer finally block not run
|
||||||
|
|
||||||
class MyString {
|
class MyString {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
//test for appropriate
|
//test for appropriate
|
||||||
|
|
||||||
class MyString {
|
class MyString {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
open class T(var value: Int) {}
|
open class T(var value: Int) {}
|
||||||
|
|
||||||
fun plusAssign(): T {
|
fun plusAssign(): T {
|
||||||
|
|||||||
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
open class T(var value: Int) {}
|
open class T(var value: Int) {}
|
||||||
|
|
||||||
fun localExtensionOnNullableParameter(): T {
|
fun localExtensionOnNullableParameter(): T {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
var log = ""
|
var log = ""
|
||||||
|
|
||||||
class A(p: String) {
|
class A(p: String) {
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
var log = ""
|
var log = ""
|
||||||
|
|
||||||
class A(p: String) {
|
class A(p: String) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class A() {
|
class A() {
|
||||||
var x = 0
|
var x = 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// !LANGUAGE: -ProhibitOperatorMod
|
// !LANGUAGE: -ProhibitOperatorMod
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
|
|
||||||
class A() {
|
class A() {
|
||||||
var x = 5
|
var x = 5
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// !LANGUAGE: -ProhibitOperatorMod
|
// !LANGUAGE: -ProhibitOperatorMod
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
|
|
||||||
class A() {
|
class A() {
|
||||||
var x = 5
|
var x = 5
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class Slot() {
|
class Slot() {
|
||||||
var vitality: Int = 10000
|
var vitality: Int = 10000
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// Enable when KT-14833 is fixed.
|
// Enable when KT-14833 is fixed.
|
||||||
// IGNORE_BACKEND: JVM
|
// IGNORE_BACKEND: JVM
|
||||||
import kotlin.reflect.KProperty
|
import kotlin.reflect.KProperty
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
var sideEffects: String = ""
|
var sideEffects: String = ""
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
internal var sideEffects: String = ""
|
internal var sideEffects: String = ""
|
||||||
|
|
||||||
internal class A {
|
internal class A {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
var sideEffects: String = ""
|
var sideEffects: String = ""
|
||||||
|
|
||||||
class A() {
|
class A() {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
var sideEffects: String = ""
|
var sideEffects: String = ""
|
||||||
|
|
||||||
abstract class B protected constructor(val arg: Int) {
|
abstract class B protected constructor(val arg: Int) {
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ FILE fqName:<root> fileName:/complexAugmentedAssignment.kt
|
|||||||
VALUE_PARAMETER name:b index:0 type:<root>.B
|
VALUE_PARAMETER name:b index:0 type:<root>.B
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public final fun <set-s> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.B' type=kotlin.Unit origin=EQ
|
CALL 'public final fun <set-s> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.B' type=kotlin.Unit origin=EQ
|
||||||
|
$this: GET_VAR '<this>: <root>.B declared in <root>.Host.plusAssign' type=<root>.B origin=null
|
||||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||||
$this: CALL 'public final fun <get-s> (): kotlin.Int declared in <root>.B' type=kotlin.Int origin=GET_PROPERTY
|
$this: CALL 'public final fun <get-s> (): kotlin.Int declared in <root>.B' type=kotlin.Int origin=GET_PROPERTY
|
||||||
$this: GET_VAR '<this>: <root>.B declared in <root>.Host.plusAssign' type=<root>.B origin=null
|
$this: GET_VAR '<this>: <root>.B declared in <root>.Host.plusAssign' type=<root>.B origin=null
|
||||||
|
|||||||
+1
@@ -17,6 +17,7 @@ FILE fqName:<root> fileName:/javaSyntheticGenericPropertyAccess.kt
|
|||||||
$this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
$this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||||
GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||||
CALL 'public open fun <set-foo> (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
CALL 'public open fun <set-foo> (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||||
|
$this: GET_VAR 'j: <root>.J<F of <root>.test> declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||||
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||||
$this: CALL 'public open fun <get-foo> (): kotlin.Int declared in <root>.J' type=kotlin.Int origin=GET_PROPERTY
|
$this: CALL 'public open fun <get-foo> (): kotlin.Int declared in <root>.J' type=kotlin.Int origin=GET_PROPERTY
|
||||||
$this: GET_VAR 'j: <root>.J<F of <root>.test> declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
$this: GET_VAR 'j: <root>.J<F of <root>.test> declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ FILE fqName:<root> fileName:/javaSyntheticPropertyAccess.kt
|
|||||||
$this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
$this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||||
GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||||
CALL 'public open fun <set-foo> (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
CALL 'public open fun <set-foo> (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||||
|
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
||||||
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||||
$this: CALL 'public open fun <get-foo> (): kotlin.Int declared in <root>.J' type=kotlin.Int origin=GET_PROPERTY
|
$this: CALL 'public open fun <get-foo> (): kotlin.Int declared in <root>.J' type=kotlin.Int origin=GET_PROPERTY
|
||||||
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ FILE fqName:<root> fileName:/kt16904.kt
|
|||||||
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1' type=<root>.Test1 origin=null
|
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1' type=<root>.Test1 origin=null
|
||||||
x: CONST Int type=kotlin.Int value=42
|
x: CONST Int type=kotlin.Int value=42
|
||||||
CALL 'public final fun <set-y> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.A' type=kotlin.Unit origin=EQ
|
CALL 'public final fun <set-y> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.A' type=kotlin.Unit origin=EQ
|
||||||
|
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1' type=<root>.Test1 origin=null
|
||||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||||
$this: CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
|
$this: CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
|
||||||
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1' type=<root>.Test1 origin=null
|
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1' type=<root>.Test1 origin=null
|
||||||
|
|||||||
Reference in New Issue
Block a user