[FIR] Fix building fir for += with complex rhs

Also fix choosing candidate for assignment operator call
This commit is contained in:
Dmitriy Novozhilov
2019-11-07 12:20:00 +03:00
parent cadc2dfe4d
commit b5210e6a9b
15 changed files with 132 additions and 73 deletions
@@ -463,22 +463,6 @@ abstract class BaseFirBuilder<T>(val session: FirSession, val context: Context =
statements += arraySet.apply { lValue = FirSimpleNamedReference(psiArrayExpression?.toFirSourceElement(), name, null) }
}
}
if (operation != FirOperation.ASSIGN &&
tokenType != REFERENCE_EXPRESSION && tokenType != THIS_EXPRESSION &&
((tokenType != DOT_QUALIFIED_EXPRESSION && tokenType != SAFE_ACCESS_EXPRESSION) || this.selectorExpression?.elementType != REFERENCE_EXPRESSION)
) {
return FirBlockImpl(this.getSourceOrNull()).apply {
val name = Name.special("<complex-set>")
statements += generateTemporaryVariable(
this@BaseFirBuilder.session, this@generateAssignment.getSourceOrNull(), name,
this@generateAssignment?.convert()
?: FirErrorExpressionImpl(this.getSourceOrNull(), FirSimpleDiagnostic("No LValue in assignment", DiagnosticKind.Syntax))
)
statements += FirVariableAssignmentImpl(source, false, value, operation).apply {
lValue = FirSimpleNamedReference(this.getSourceOrNull(), name, null)
}
}
}
if (operation in FirOperation.ASSIGNMENTS && operation != FirOperation.ASSIGN) {
return FirOperatorCallImpl(source, operation).apply {
@@ -64,11 +64,10 @@ FILE: lambda.kt
public? final? fun test(list: List<Int>): R|kotlin/Unit| {
lval map: <implicit> = mutableMapOf#<Int, String>()
list#.forEach#(<L> = forEach@fun <implicit>.<anonymous>(): <implicit> {
lval <complex-set>: <implicit> = map#.getOrPut#(it#, getOrPut@fun <implicit>.<anonymous>(): <implicit> {
+=(map#.getOrPut#(it#, getOrPut@fun <implicit>.<anonymous>(): <implicit> {
mutableListOf#()
}
)
<complex-set># += String()
), String())
}
)
}
@@ -11,6 +11,5 @@ FILE: modifications.kt
+=(this#, String(Omega))
}
public? final? fun Any.modify(): R|kotlin/Unit| {
lval <complex-set>: <implicit> = (this# as List<Int>)
<complex-set># += Int(42)
+=((this# as List<Int>), Int(42))
}
@@ -37,6 +37,10 @@ class FirOperatorAmbiguityError(val candidates: Collection<AbstractFirBasedSymbo
override val reason: String get() = "Operator overload ambiguity. Compatible candidates: ${candidates.map { describeSymbol(it) }}"
}
class FirVariableExpectedError : FirDiagnostic() {
override val reason: String get() = "Variable expected"
}
private fun describeSymbol(symbol: AbstractFirBasedSymbol<*>): String {
return when (symbol) {
is FirClassLikeSymbol<*> -> symbol.classId.asString()
@@ -56,6 +56,7 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect
is FirInapplicableCandidateError -> FirErrors.INAPPLICABLE_CANDIDATE.onSource(source, diagnostic.candidates)
is FirAmbiguityError -> FirErrors.AMBIGUITY.onSource(source, diagnostic.candidates)
is FirOperatorAmbiguityError -> FirErrors.ASSIGN_OPERATOR_AMBIGUITY.onSource(source, diagnostic.candidates)
is FirVariableExpectedError -> Errors.VARIABLE_EXPECTED.onSource(source)
is FirSimpleDiagnostic -> diagnostic.getFactory().onSource(source)
FirEmptyDiagnostic -> null
else -> throw IllegalArgumentException("Unsupported diagnostic type: ${diagnostic.javaClass}")
@@ -7,7 +7,9 @@ package org.jetbrains.kotlin.fir.resolve.transformers.body.resolve
import org.jetbrains.kotlin.fir.BuiltinTypes
import org.jetbrains.kotlin.fir.FirCallResolver
import org.jetbrains.kotlin.fir.declarations.FirProperty
import org.jetbrains.kotlin.fir.declarations.FirTypeParametersOwner
import org.jetbrains.kotlin.fir.declarations.FirVariable
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
import org.jetbrains.kotlin.fir.diagnostics.FirSimpleDiagnostic
import org.jetbrains.kotlin.fir.expressions.*
@@ -26,13 +28,14 @@ import org.jetbrains.kotlin.fir.resolve.*
import org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext
import org.jetbrains.kotlin.fir.resolve.calls.candidate
import org.jetbrains.kotlin.fir.resolve.diagnostics.FirOperatorAmbiguityError
import org.jetbrains.kotlin.fir.resolve.diagnostics.FirUnresolvedReferenceError
import org.jetbrains.kotlin.fir.resolve.diagnostics.FirVariableExpectedError
import org.jetbrains.kotlin.fir.resolve.transformers.InvocationKindTransformer
import org.jetbrains.kotlin.fir.resolve.transformers.StoreReceiver
import org.jetbrains.kotlin.fir.resolvedTypeFromPrototype
import org.jetbrains.kotlin.fir.scopes.impl.withReplacedConeType
import org.jetbrains.kotlin.fir.symbols.StandardClassIds
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol
import org.jetbrains.kotlin.fir.symbols.invoke
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.types.impl.ConeClassTypeImpl
@@ -200,13 +203,13 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
}
override fun transformOperatorCall(operatorCall: FirOperatorCall, data: ResolutionMode): CompositeTransformResult<FirStatement> {
val result = if (operatorCall.operation in FirOperation.BOOLEANS) {
(operatorCall.transformChildren(transformer, ResolutionMode.ContextIndependent) as FirOperatorCall).also {
if (operatorCall.operation in FirOperation.BOOLEANS) {
val result = (operatorCall.transformChildren(transformer, ResolutionMode.ContextIndependent) as FirOperatorCall).also {
it.resultType = builtinTypes.booleanType
}
} else {
transformExpression(operatorCall, data).single
} as FirOperatorCall
dataFlowAnalyzer.exitOperatorCall(result)
return result.compose()
}
if (operatorCall.operation in FirOperation.ASSIGNMENTS) {
require(operatorCall.operation != FirOperation.ASSIGN)
@@ -230,20 +233,24 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
val assignOperatorCall = createFunctionCall(assignmentOperatorName)
val resolvedAssignCall = assignOperatorCall.transformSingle(this, ResolutionMode.ContextIndependent)
val assignCallReference = resolvedAssignCall.toResolvedCallableReference()
// x + y
val assignIsError = resolvedAssignCall.typeRef is FirErrorTypeRef
// x = x + y
val simpleOperatorName = FirOperationNameConventions.ASSIGNMENTS_TO_SIMPLE_OPERATOR.getValue(operatorCall.operation)
val simpleOperatorCall = createFunctionCall(simpleOperatorName)
val resolvedOperatorCall = simpleOperatorCall.transformSingle(this, ResolutionMode.ContextIndependent)
val operatorCallReference = resolvedOperatorCall.toResolvedCallableReference()
val property = (leftArgument.toResolvedCallableSymbol() as? FirPropertySymbol)?.fir
val lhsReference = leftArgument.toResolvedCallableReference()
val lhsIsVar = (lhsReference?.resolvedSymbol as? FirVariableSymbol<*>)?.fir?.isVar == true
return when {
operatorCallReference == null || property?.isVal == true -> resolvedAssignCall.compose()
operatorCallReference == null || (!lhsIsVar && !assignIsError) -> resolvedAssignCall.compose()
assignCallReference == null -> {
val assignment =
FirVariableAssignmentImpl(operatorCall.source, false, resolvedOperatorCall, FirOperation.ASSIGN).apply {
lValue = (leftArgument as? FirQualifiedAccess)?.calleeReference
?: FirErrorNamedReferenceImpl(null, FirUnresolvedReferenceError())
lValue = if (lhsIsVar)
lhsReference!!
else
FirErrorNamedReferenceImpl(operatorCall.arguments.first().source, FirVariableExpectedError())
}
assignment.transform(transformer, ResolutionMode.ContextIndependent)
}
@@ -254,8 +261,7 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
}
}
dataFlowAnalyzer.exitOperatorCall(result)
return result.compose()
throw IllegalArgumentException(operatorCall.render())
}
override fun transformTypeOperatorCall(typeOperatorCall: FirTypeOperatorCall, data: ResolutionMode): CompositeTransformResult<FirStatement> {
@@ -0,0 +1,10 @@
var x: Int = 1
set(value) {
field += value
}
val y: Int = 1
get() {
<!VARIABLE_EXPECTED!>field<!> += 1
return 1
}
@@ -0,0 +1,11 @@
FILE: fieldPlusAssign.kt
public final var x: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Int|
public set(value: R|kotlin/Int|): R|kotlin/Unit| {
F|/x| = F|/x|.R|kotlin/Int.plus|(R|<local>/value|)
}
public final val y: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Int| {
<Variable expected># = F|/y|.R|kotlin/Int.plus|(Int(1))
^ Int(1)
}
@@ -0,0 +1,19 @@
fun List<String>.modify() {
<!VARIABLE_EXPECTED!>this<!> += "Alpha"
<!VARIABLE_EXPECTED!>this<!> += "Omega"
}
fun Any.modify() {
(<!VARIABLE_EXPECTED!>this as List<Int><!>) += 42
}
operator fun <T> Set<T>.plusAssign(x: T) {}
fun Set<String>.modify() {
this += "Alpha"
this += "Omega"
}
fun Any.modifySet() {
(this as Set<Int>) += 42
}
@@ -0,0 +1,17 @@
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))
}
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))
}
public final operator fun <T> R|kotlin/collections/Set<T>|.plusAssign(x: R|T|): R|kotlin/Unit| {
}
public final fun R|kotlin/collections/Set<kotlin/String>|.modify(): R|kotlin/Unit| {
this@R|/modify|.R|/plusAssign|<R|kotlin/String|>(String(Alpha))
this@R|/modify|.R|/plusAssign|<R|kotlin/String|>(String(Omega))
}
public final fun R|kotlin/Any|.modifySet(): R|kotlin/Unit| {
(this@R|/modifySet| as R|kotlin/collections/Set<kotlin/Int>|).R|/plusAssign|<R|kotlin/Int|>(Int(42))
}
@@ -230,6 +230,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/resolve/testData/resolve/arguments/default.kt");
}
@TestMetadata("fieldPlusAssign.kt")
public void testFieldPlusAssign() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/arguments/fieldPlusAssign.kt");
}
@TestMetadata("invoke.kt")
public void testInvoke() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/arguments/invoke.kt");
@@ -98,6 +98,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic
runTest("compiler/fir/resolve/testData/resolve/stdlib/implicitReceiverOrder.kt");
}
@TestMetadata("listPlusAssign.kt")
public void testListPlusAssign() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/stdlib/listPlusAssign.kt");
}
@TestMetadata("mapList.kt")
public void testMapList() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/stdlib/mapList.kt");
@@ -40,15 +40,13 @@ FILE fqName:<root> fileName:/augmentedAssignmentWithExpression.kt
x: CONST Int type=kotlin.Int value=1
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.Host [val]
CALL 'public final fun foo (): <root>.Host declared in <root>' type=<root>.Host origin=null
SET_VAR 'val tmp_0: <root>.Host [val] declared in <root>.test3' type=<root>.Host origin=null
CONST Int type=<root>.Host value=1
CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit declared in <root>.Host' type=kotlin.Unit origin=null
$this: CALL 'public final fun foo (): <root>.Host declared in <root>' type=<root>.Host origin=null
x: CONST Int type=kotlin.Int value=1
FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0<<root>.Host>) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:kotlin.Function0<<root>.Host>
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.Host [val]
CALL 'public abstract fun invoke (): <root>.Host declared in kotlin.Function0' type=<root>.Host origin=null
CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit declared in <root>.Host' type=kotlin.Unit origin=null
$this: CALL 'public abstract fun invoke (): <root>.Host declared in kotlin.Function0' type=<root>.Host origin=null
$this: GET_VAR 'a: kotlin.Function0<<root>.Host> declared in <root>.test4' type=kotlin.Function0<<root>.Host> origin=null
SET_VAR 'val tmp_1: <root>.Host [val] declared in <root>.test4' type=<root>.Host origin=null
CONST Int type=<root>.Host value=1
x: CONST Int type=kotlin.Int value=1
@@ -10,4 +10,4 @@ FILE fqName:<root> fileName:/javaSyntheticPropertyAccess.kt
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
ERROR_CALL 'Unresolved reference: R|/J.foo|' type=IrErrorType
GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
ERROR_CALL 'Unresolved reference: R|/J.foo|' type=IrErrorType
ERROR_CALL 'Unresolved reference: <Variable expected>#' type=IrErrorType
+31 -30
View File
@@ -28,61 +28,58 @@ FILE fqName:<root> fileName:/kt30020.kt
$receiver: CALL 'public abstract fun <get-xs> (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any> origin=null
$this: GET_VAR 'x: <root>.X declared in <root>.test' type=<root>.X origin=null
element: CONST Int type=kotlin.Int value=1
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.MutableList<kotlin.Any> [val]
CALL 'public abstract fun f (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any> origin=null
CALL 'public final fun plusAssign (element: T of <uninitialized parent>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
$receiver: CALL 'public abstract fun f (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any> origin=null
$this: GET_VAR 'x: <root>.X declared in <root>.test' type=<root>.X origin=null
SET_VAR 'val tmp_0: kotlin.collections.MutableList<kotlin.Any> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Any> origin=null
CONST Int type=kotlin.collections.MutableList<kotlin.Any> value=2
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.MutableList<kotlin.Int> [val]
TYPE_OP type=kotlin.collections.MutableList<kotlin.Int> origin=CAST typeOperand=kotlin.collections.MutableList<kotlin.Int>
CALL 'public abstract fun <get-xs> (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any> origin=null
element: CONST Int type=kotlin.Int value=2
CALL 'public final fun plusAssign (element: T of <uninitialized parent>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
$receiver: TYPE_OP type=kotlin.collections.MutableList<kotlin.Int> origin=CAST typeOperand=kotlin.collections.MutableList<kotlin.Int>
CALL 'public abstract fun <get-xs> (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Int> origin=null
$this: GET_VAR 'x: <root>.X declared in <root>.test' type=<root>.X origin=null
SET_VAR 'val tmp_1: kotlin.collections.MutableList<kotlin.Int> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
CONST Int type=kotlin.collections.MutableList<kotlin.Int> value=3
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.MutableList<kotlin.Int> [val]
TYPE_OP type=kotlin.collections.MutableList<kotlin.Int> origin=CAST typeOperand=kotlin.collections.MutableList<kotlin.Int>
element: CONST Int type=kotlin.Int value=3
CALL 'public final fun plusAssign (element: T of <uninitialized parent>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
$receiver: TYPE_OP type=kotlin.collections.MutableList<kotlin.Int> origin=CAST typeOperand=kotlin.collections.MutableList<kotlin.Int>
CALL 'public abstract fun f (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any> origin=null
$this: GET_VAR 'x: <root>.X declared in <root>.test' type=<root>.X origin=null
SET_VAR 'val tmp_2: kotlin.collections.MutableList<kotlin.Int> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
CONST Int type=kotlin.collections.MutableList<kotlin.Int> value=4
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.MutableList<kotlin.Int> [val]
BLOCK type=kotlin.collections.MutableList<kotlin.Int> origin=EXCLEXCL
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.MutableList<kotlin.Int> [val]
element: CONST Int type=kotlin.Int value=4
CALL 'public final fun plusAssign (element: T of <uninitialized parent>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
$receiver: BLOCK type=kotlin.collections.MutableList<kotlin.Int> origin=EXCLEXCL
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.MutableList<kotlin.Int> [val]
CALL 'public abstract fun <get-xs> (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Int> origin=null
$this: GET_VAR 'nx: <root>.X? declared in <root>.test' type=<root>.X? origin=null
WHEN type=kotlin.collections.MutableList<kotlin.Int> origin=EXCLEXCL
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_4: kotlin.collections.MutableList<kotlin.Int> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
arg0: GET_VAR 'val tmp_0: kotlin.collections.MutableList<kotlin.Int> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: THROW type=kotlin.Nothing
CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.KotlinNullPointerException' type=kotlin.KotlinNullPointerException origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val tmp_4: kotlin.collections.MutableList<kotlin.Int> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
SET_VAR 'val tmp_3: kotlin.collections.MutableList<kotlin.Int> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
CONST Int type=kotlin.collections.MutableList<kotlin.Int> value=5
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.MutableList<kotlin.Int> [val]
BLOCK type=kotlin.collections.MutableList<kotlin.Int> origin=EXCLEXCL
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.collections.MutableList<kotlin.Any>? [val]
then: GET_VAR 'val tmp_0: kotlin.collections.MutableList<kotlin.Int> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
element: CONST Int type=kotlin.Int value=5
CALL 'public final fun plusAssign (element: T of <uninitialized parent>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
$receiver: BLOCK type=kotlin.collections.MutableList<kotlin.Int> origin=EXCLEXCL
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.MutableList<kotlin.Any>? [val]
CALL 'public abstract fun f (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any>? origin=null
$this: GET_VAR 'nx: <root>.X? declared in <root>.test' type=<root>.X origin=null
WHEN type=kotlin.collections.MutableList<kotlin.Int> origin=EXCLEXCL
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_6: kotlin.collections.MutableList<kotlin.Any>? [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Any>? origin=null
arg0: GET_VAR 'val tmp_1: kotlin.collections.MutableList<kotlin.Any>? [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Any>? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: THROW type=kotlin.Nothing
CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.KotlinNullPointerException' type=kotlin.KotlinNullPointerException origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val tmp_6: kotlin.collections.MutableList<kotlin.Any>? [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
SET_VAR 'val tmp_5: kotlin.collections.MutableList<kotlin.Int> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
CONST Int type=kotlin.collections.MutableList<kotlin.Int> value=6
then: GET_VAR 'val tmp_1: kotlin.collections.MutableList<kotlin.Any>? [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Int> origin=null
element: CONST Int type=kotlin.Int value=6
FUN name:testExtensionReceiver visibility:public modality:FINAL <> ($receiver:kotlin.collections.MutableList<kotlin.Any>) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.MutableList<kotlin.Any>
BLOCK_BODY
ERROR_EXPR 'Operator overload ambiguity. Compatible candidates: [kotlin/collections/plus, kotlin/collections/plusAssign]' type=IrErrorType
CALL 'public final fun plusAssign (element: T of <uninitialized parent>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
$receiver: GET_VAR '<this>: kotlin.collections.MutableList<kotlin.Any> declared in <root>.testExtensionReceiver' type=kotlin.collections.MutableList<kotlin.Any> origin=null
element: CONST Int type=kotlin.Int value=100
CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList<kotlin.Int>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.AML
CONSTRUCTOR visibility:public <> () returnType:<root>.AML [primary]
@@ -92,7 +89,9 @@ FILE fqName:<root> fileName:/kt30020.kt
FUN name:testExplicitThis visibility:public modality:FINAL <> ($this:<root>.AML) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.AML
BLOCK_BODY
ERROR_EXPR 'Operator overload ambiguity. Compatible candidates: [kotlin/collections/plus, kotlin/collections/plusAssign]' type=IrErrorType
CALL 'public final fun plusAssign (element: T of <uninitialized parent>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
$receiver: GET_VAR '<this>: <root>.AML declared in <root>.AML' type=<root>.AML origin=null
element: CONST Int type=kotlin.Int value=200
CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.AML.Inner
CONSTRUCTOR visibility:public <> () returnType:<root>.AML.Inner [primary]
@@ -102,7 +101,9 @@ FILE fqName:<root> fileName:/kt30020.kt
FUN name:testOuterThis visibility:public modality:FINAL <> ($this:<root>.AML.Inner) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.AML.Inner
BLOCK_BODY
ERROR_EXPR 'Operator overload ambiguity. Compatible candidates: [kotlin/collections/plus, kotlin/collections/plusAssign]' type=IrErrorType
CALL 'public final fun plusAssign (element: T of <uninitialized parent>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
$receiver: GET_VAR '<this>: <root>.AML declared in <root>.AML' type=<root>.AML origin=null
element: CONST Int type=kotlin.Int value=300
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any