From f7b6fec70c636968cef5e95934f1a7eb02cc6e1e Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 15 May 2019 16:01:23 +0300 Subject: [PATCH] [FIR] Transform explicit receiver of QAE properly --- .../fir/resolve/transformers/FirBodyResolveTransformer.kt | 4 ++-- .../ir/irText/expressions/boundCallableReferences.fir.txt | 2 +- .../ir/irText/expressions/callableRefToGenericMember.fir.txt | 2 +- .../ir/irText/types/localVariableOfIntersectionType.fir.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirBodyResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirBodyResolveTransformer.kt index 0160e0a0d9c..8e408045831 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirBodyResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirBodyResolveTransformer.kt @@ -246,11 +246,11 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn private fun transformCallee(qualifiedAccess: T): T { val callee = qualifiedAccess.calleeReference as? FirSimpleNamedReference ?: return qualifiedAccess - val receiver = qualifiedAccess.explicitReceiver?.transformSingle(this, noExpectedType) + val qualifiedAccess = qualifiedAccess.transformExplicitReceiver(this, noExpectedType) val info = CallInfo( CallKind.VariableAccess, - receiver, + qualifiedAccess.explicitReceiver, emptyList(), qualifiedAccess.safe, emptyList(), diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt index a0cc95d8866..99c298cda6b 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt @@ -47,7 +47,7 @@ FILE fqName: fileName:/boundCallableReferences.kt FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null - $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=IrErrorType origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt index ecf98199829..c709f0da076 100644 --- a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt @@ -46,7 +46,7 @@ FILE fqName: fileName:/callableRefToGenericMember.kt FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null - $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=IrErrorType origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null : FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt index 872a5f3ceba..01d0850211e 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt @@ -98,7 +98,7 @@ FILE fqName: fileName:/localVariableOfIntersectionType.kt ERROR_CALL 'Unresolved reference: #' type=IrErrorType VAR name:t type:T of .Inv [val] CALL 'public abstract fun (): T of .Inv declared in .Inv' type=T of .Inv origin=null - $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=IrErrorType origin=null + $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=.Inv<.IA> origin=null : $this: GET_VAR 'z: .Z declared in .test' type=.Z origin=null x: GET_VAR 'a: .In<.IA> declared in .test' type=.In<.IA> origin=null