diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateCollector.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateCollector.kt index 105a650297d..f005017508d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateCollector.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateCollector.kt @@ -88,6 +88,8 @@ class InvokeReceiverCandidateCollector( (candidate.symbol as ConeCallableSymbol).callableId.callableName, candidate ) + dispatchReceiver = candidate.dispatchReceiverExpression() + extensionReceiver = candidate.extensionReceiverExpression() typeRef = callResolver.typeCalculator.tryCalculateReturnType(candidate.symbol.firUnsafe()) }, invokeCallInfo.arguments, diff --git a/compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver.txt b/compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver.txt index 44b923b6950..b03cf755382 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver.txt @@ -14,7 +14,7 @@ FILE: explicitReceiver.kt } public final fun bar(): R|Foo| { - ^bar D|R|/Foo.x||.R|/Foo.invoke|() + ^bar D|D|this@R|/Foo||.R|/Foo.x||.R|/Foo.invoke|() } } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver2.txt b/compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver2.txt index 1b9ab17bd7b..840a61feef8 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver2.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/invoke/explicitReceiver2.txt @@ -24,7 +24,7 @@ FILE: explicitReceiver2.kt public get(): R|Bar| public final fun bar(): R|Foo| { - ^bar D|R|/Foo.x||.R|/Bar.invoke|() + ^bar D|D|this@R|/Foo||.R|/Foo.x||.R|/Bar.invoke|() } } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/invoke/extension.txt b/compiler/fir/resolve/testData/resolve/expresssions/invoke/extension.txt index caaa745d050..8a5f3f992d2 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/invoke/extension.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/invoke/extension.txt @@ -14,7 +14,7 @@ FILE: extension.kt public get(): R|kotlin/Int| public final fun foo(): R|Foo| { - ^foo D|this@R|/Foo||E|R|/Foo.x||.R|/Foo.invoke|() + ^foo D|this@R|/Foo||E|D|this@R|/Foo||.R|/Foo.x||.R|/Foo.invoke|() } } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/multipleImplicitReceivers.txt b/compiler/fir/resolve/testData/resolve/stdlib/multipleImplicitReceivers.txt index 34fc7b1639b..8b425903faf 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/multipleImplicitReceivers.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/multipleImplicitReceivers.txt @@ -29,7 +29,7 @@ FILE: multipleImplicitReceivers.kt R|kotlin/with|(R|/fooImpl|, = with@fun R|IFoo|.(it: R|IFoo|): R|kotlin/Unit| { D|this@R|/IFoo||E|this@R|special/anonymous||.R|/IFoo.foo| R|kotlin/with|(R|/invokeImpl|, = with@fun R|IInvoke|.(it: R|IInvoke|): R|kotlin/Unit| { - D|this@R|/IInvoke||E|R|/IFoo.foo||.R|/IInvoke.invoke|() + D|this@R|/IInvoke||E|D|this@R|/IFoo||E|this@R|special/anonymous||.R|/IFoo.foo||.R|/IInvoke.invoke|() } ) } diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt index db0dc3173e0..426e8e90371 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -13,7 +13,7 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:value2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:public [final] + FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:private [final] EXPRESSION_BODY CONST String type=kotlin.String value="OK" FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X.B) returnType:kotlin.String @@ -21,22 +21,23 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt $this: VALUE_PARAMETER name: type:.X.B BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .X.B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:public [final]' type=kotlin.String origin=null + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .X.B declared in .X.B.' type=.X.B origin=null PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:public [final] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.X.B) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.X.B BLOCK_BODY CALL 'public final fun (): kotlin.String declared in .X.B' type=kotlin.String origin=null + $this: GET_VAR ': .X.B declared in .X.B' type=.X.B origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X.B) returnType:kotlin.Function0 correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.X.B BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in .X.B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:public [final]' type=kotlin.Function0 origin=null + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:private [final]' type=kotlin.Function0 origin=null receiver: GET_VAR ': .X.B declared in .X.B.' type=.X.B origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: @@ -82,3 +83,4 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CALL 'public abstract fun invoke (): kotlin.String declared in kotlin.Function0' type=kotlin.String origin=null $this: CALL 'public abstract fun (): kotlin.Function0 declared in .X' type=kotlin.Function0 origin=null + $this: GET_OBJECT 'CLASS ENUM_ENTRY name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X