From bf918e6184a65c982d1adac58bd4099cf9809349 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Mon, 31 Aug 2020 21:55:25 -0700 Subject: [PATCH] FIR: hide local types if needed --- .../resolve/diagnostics/sealedSupertype.txt | 4 +- .../testData/resolve/objectInnerClass.txt | 14 ++--- .../FirDeclarationsResolveTransformer.kt | 59 ++++++++++++++++++- .../closures/crossinlineLocalDeclaration.kt | 1 - .../crossInlineWithCapturedOuterReceiver.kt | 1 - .../javaInterop/objectWithSeveralSuspends.kt | 1 - .../coroutines/javaInterop/returnObject.kt | 1 - .../coroutines/javaInterop/severalCaptures.kt | 1 - .../codegen/box/coroutines/kt21605.kt | 1 - .../tailCallOptimizations/unit/override4.kt | 1 - .../tailCallOptimizations/unit/override6.kt | 1 - .../unambiguousObjectExpressionType.fir.kt | 12 ++-- .../classes/objectLiteralExpressions.fir.txt | 16 ++--- .../funInterface/partialSam.fir.txt | 20 +++---- .../multipleThisReferences.fir.txt | 4 +- .../thisOfGenericOuterClass.fir.txt | 4 +- 16 files changed, 93 insertions(+), 48 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.txt index ac640051b40..80e01f0bf6d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.txt @@ -70,14 +70,14 @@ FILE: sealedSupertype.kt public get(): R|P| - public final val r: R|| = object : R|P| { + public final val r: R|P| = object : R|P| { private constructor(): R|| { super() } } - public get(): R|| + public get(): R|P| } public final class K : R|P| { diff --git a/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt b/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt index cc2eb182a0a..de2e3414f51 100644 --- a/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt +++ b/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt @@ -1,5 +1,5 @@ FILE: objectInnerClass.kt - public final val case1: R|| = object : R|A| { + public final val case1: R|A| = object : R|A| { private constructor(): R|| { super() } @@ -61,13 +61,13 @@ FILE: objectInnerClass.kt } - public get(): R|| + public get(): R|A| public final class Case2 : R|kotlin/Any| { public constructor(): R|Case2| { super() } - public final val x: R|| = object : R|Case2.Base| { + public final val x: R|Case2.Base| = object : R|Case2.Base| { private constructor(): R|| { this@R|/Case2|.super(R|/B.B|()) } @@ -85,7 +85,7 @@ FILE: objectInnerClass.kt } - public get(): R|| + public get(): R|Case2.Base| public final fun R|Case2.Base|.hoo(): R|kotlin/Unit| { lval x: R|B| = this@R|/Case2.hoo|.R|/Case2.Base.property| @@ -112,7 +112,7 @@ FILE: objectInnerClass.kt } public final fun caseForChild(): R|kotlin/Unit| { - lval child: R|| = this@R|/Case2|.R|/Case2.x| + lval child: R|Case2.Base| = this@R|/Case2|.R|/Case2.x| R|/child|.R|/Case2.Base.baseFun|() R|/child|.R|/Case2.Base.property| (this@R|/Case2|, R|/child|).R|/Case2.hoo|() @@ -124,7 +124,7 @@ FILE: objectInnerClass.kt super() } - public final val x: R|| = object : R|A| { + public final val x: R|A| = object : R|A| { private constructor(): R|| { super() } @@ -186,7 +186,7 @@ FILE: objectInnerClass.kt } - public get(): R|| + public get(): R|A| } public abstract interface A : R|kotlin/Any| { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index 30579ab60cc..8be6341dd05 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -29,6 +29,7 @@ import org.jetbrains.kotlin.fir.resolve.transformers.* import org.jetbrains.kotlin.fir.scopes.impl.FirLocalScope import org.jetbrains.kotlin.fir.scopes.impl.FirMemberTypeParameterScope import org.jetbrains.kotlin.fir.symbols.constructStarProjectedType +import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLookupTagWithFixedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef @@ -497,8 +498,14 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor val body = result.body if (result.returnTypeRef is FirImplicitTypeRef) { + val simpleFunction = function as? FirSimpleFunction if (body != null) { - result.transformReturnTypeRef(transformer, withExpectedType(body.resultType)) + result.transformReturnTypeRef( + transformer, + withExpectedType( + body.resultType.hideLocalTypeIfNeeded(simpleFunction?.visibility, simpleFunction?.isInline == true) + ) + ) } else { result.transformReturnTypeRef( transformer, @@ -904,7 +911,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor } variable.transformReturnTypeRef( transformer, - withExpectedType(expectedType) + withExpectedType(expectedType.hideLocalTypeIfNeeded((variable as? FirProperty)?.visibility)) ) } variable.getter != null && variable.getter !is FirDefaultPropertyAccessor -> { @@ -926,7 +933,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor } variable.transformReturnTypeRef( transformer, - withExpectedType(expectedType) + withExpectedType(expectedType?.hideLocalTypeIfNeeded((variable as? FirProperty)?.visibility)) ) } else -> { @@ -949,6 +956,52 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor } } + /* + * Suppose a function without an explicit return type just returns an anonymous object: + * + * fun foo(...) = object : ObjectSuperType { + * override fun ... + * } + * + * Without unwrapping, the return type ended up with that anonymous object (), while the resolved super type, which + * acts like an implementing interface, is a better fit. In fact, exposing an anonymous object types is prohibited for certain cases, + * e.g., KT-33917. We can also apply this to any local types. + */ + private fun FirTypeRef.hideLocalTypeIfNeeded( + containingCallableVisibility: Visibility?, + isInlineFunction: Boolean = false + ): FirTypeRef { + if (containingCallableVisibility == null) { + return this + } + // Approximate types for non-private (all but package private or private) members. + // Also private inline functions, as per KT-33917. + if (containingCallableVisibility == Visibilities.Public || + containingCallableVisibility == Visibilities.Protected || + containingCallableVisibility == Visibilities.Internal || + (containingCallableVisibility == Visibilities.Private && isInlineFunction) + ) { + val firClass = + (((this as? FirResolvedTypeRef) + ?.type as? ConeClassLikeType) + ?.lookupTag as? ConeClassLookupTagWithFixedSymbol) + ?.symbol?.fir + if (firClass?.classId?.isLocal != true) { + return this + } + if (firClass.superTypeRefs.size > 1) { + return buildErrorTypeRef { + diagnostic = ConeSimpleDiagnostic("Cannot hide local type ${firClass.render()}") + } + } + val superType = firClass.superTypeRefs.single() + if (superType is FirResolvedTypeRef && !superType.isAny) { + return superType + } + } + return this + } + private object ImplicitToErrorTypeTransformer : FirTransformer() { override fun transformElement(element: E, data: Nothing?): CompositeTransformResult { return element.compose() diff --git a/compiler/testData/codegen/box/closures/crossinlineLocalDeclaration.kt b/compiler/testData/codegen/box/closures/crossinlineLocalDeclaration.kt index 1a59ff9e4f7..602f32029a8 100644 --- a/compiler/testData/codegen/box/closures/crossinlineLocalDeclaration.kt +++ b/compiler/testData/codegen/box/closures/crossinlineLocalDeclaration.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME interface Wrapper { fun runBlock() } diff --git a/compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt b/compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt index cc8e69d424c..296199d5562 100644 --- a/compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt +++ b/compiler/testData/codegen/box/coroutines/crossInlineWithCapturedOuterReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // COMMON_COROUTINES_TEST // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/coroutines/javaInterop/objectWithSeveralSuspends.kt b/compiler/testData/codegen/box/coroutines/javaInterop/objectWithSeveralSuspends.kt index c1f276024bd..45089b9df38 100644 --- a/compiler/testData/codegen/box/coroutines/javaInterop/objectWithSeveralSuspends.kt +++ b/compiler/testData/codegen/box/coroutines/javaInterop/objectWithSeveralSuspends.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // COMMON_COROUTINES_TEST // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/coroutines/javaInterop/returnObject.kt b/compiler/testData/codegen/box/coroutines/javaInterop/returnObject.kt index d1e3a64cd98..fadae10ebbf 100644 --- a/compiler/testData/codegen/box/coroutines/javaInterop/returnObject.kt +++ b/compiler/testData/codegen/box/coroutines/javaInterop/returnObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // COMMON_COROUTINES_TEST // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/coroutines/javaInterop/severalCaptures.kt b/compiler/testData/codegen/box/coroutines/javaInterop/severalCaptures.kt index ab73a6ea5bb..7dbd4704982 100644 --- a/compiler/testData/codegen/box/coroutines/javaInterop/severalCaptures.kt +++ b/compiler/testData/codegen/box/coroutines/javaInterop/severalCaptures.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // COMMON_COROUTINES_TEST // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/coroutines/kt21605.kt b/compiler/testData/codegen/box/coroutines/kt21605.kt index 8a7c6d2eadd..738382154f8 100644 --- a/compiler/testData/codegen/box/coroutines/kt21605.kt +++ b/compiler/testData/codegen/box/coroutines/kt21605.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/override4.kt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/override4.kt index a0395223c16..cfecc2c2284 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/override4.kt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/override4.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/override6.kt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/override6.kt index 62f7bbc97cd..12a5e16eb46 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/override6.kt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/override6.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK // WITH_RUNTIME diff --git a/compiler/testData/diagnostics/tests/declarationChecks/unambiguousObjectExpressionType.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/unambiguousObjectExpressionType.fir.kt index edca51dff64..0b2b2de5377 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/unambiguousObjectExpressionType.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/unambiguousObjectExpressionType.fir.kt @@ -27,7 +27,7 @@ class Foo { privateProperty.visible() protected2Property.invisible() public2Property.invisible() - internalProperty.invisible() + internalProperty.invisible() } @@ -51,7 +51,7 @@ class Foo { protected2Function().f1() privateFunction().visible() - internalFunction().invisible() + internalFunction().invisible() public2Function().invisible() protected2Function().invisible() } @@ -81,7 +81,7 @@ class Foo { privateProperty.visible() protected2Property.invisible() public2Property.invisible() - internalProperty.invisible() + internalProperty.invisible() } @@ -105,7 +105,7 @@ class Foo { protected2Function().f1() privateFunction().visible() - internalFunction().invisible() + internalFunction().invisible() public2Function().invisible() protected2Function().invisible() } @@ -137,7 +137,7 @@ fun testProperties() { packagePublic2Property.f1() packagePrivateProperty.invisible() - packageInternalProperty.invisible() + packageInternalProperty.invisible() packagePublic2Property.invisible() } @@ -160,7 +160,7 @@ fun testFunctions() { public2Function().f1() privateFunction().invisible() - internalFunction().invisible() + internalFunction().invisible() public2Function().invisible() } diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt index 93db5694e71..1344fe63c00 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt @@ -46,7 +46,7 @@ FILE fqName: fileName:/objectLiteralExpressions.kt RETURN type=kotlin.Nothing from='public final fun (): .test1. declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:.test1. visibility:private [final,static]' type=.test1. origin=null PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:.test2. visibility:private [final,static] + FIELD PROPERTY_BACKING_FIELD name:test2 type:.IFoo visibility:private [final,static] EXPRESSION_BODY BLOCK type=.test2. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IFoo] @@ -76,11 +76,11 @@ FILE fqName: fileName:/objectLiteralExpressions.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test2.' type=.test2. origin=OBJECT_LITERAL - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.test2. + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.IFoo correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .test2. declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:.test2. visibility:private [final,static]' type=.test2. origin=null + RETURN type=kotlin.Nothing from='public final fun (): .IFoo declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:.IFoo visibility:private [final,static]' type=.IFoo origin=null CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] @@ -111,10 +111,10 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer) returnType:.Outer.test3. + FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer) returnType:.Outer.Inner $this: VALUE_PARAMETER name: type:.Outer BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (): .Outer.test3. declared in .Outer' + RETURN type=kotlin.Nothing from='public final fun test3 (): .Outer.Inner declared in .Outer' BLOCK type=.Outer.test3. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.test3. @@ -157,10 +157,10 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test4 visibility:public modality:FINAL <> ($receiver:.Outer) returnType:.test4. + FUN name:test4 visibility:public modality:FINAL <> ($receiver:.Outer) returnType:.Outer.Inner $receiver: VALUE_PARAMETER name: type:.Outer BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4 (): .test4. declared in ' + RETURN type=kotlin.Nothing from='public final fun test4 (): .Outer.Inner declared in ' BLOCK type=.test4. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test4. diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt index 44f04c877e6..e4654ff03e5 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt @@ -56,7 +56,7 @@ FILE fqName: fileName:/partialSam.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:fsi visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:fsi type:.fsi. visibility:private [final,static] + FIELD PROPERTY_BACKING_FIELD name:fsi type:.Fn visibility:private [final,static] EXPRESSION_BODY BLOCK type=.fsi. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn] @@ -89,13 +89,13 @@ FILE fqName: fileName:/partialSam.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'private constructor () [primary] declared in .fsi.' type=.fsi. origin=OBJECT_LITERAL - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.fsi. + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Fn correspondingProperty: PROPERTY name:fsi visibility:public modality:FINAL [val] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .fsi. declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fsi type:.fsi. visibility:private [final,static]' type=.fsi. origin=null + RETURN type=kotlin.Nothing from='public final fun (): .Fn declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fsi type:.Fn visibility:private [final,static]' type=.Fn origin=null PROPERTY name:fis visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:fis type:.fis. visibility:private [final,static] + FIELD PROPERTY_BACKING_FIELD name:fis type:.Fn visibility:private [final,static] EXPRESSION_BODY BLOCK type=.fis. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn] @@ -128,18 +128,18 @@ FILE fqName: fileName:/partialSam.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any CONSTRUCTOR_CALL 'private constructor () [primary] declared in .fis.' type=.fis. origin=OBJECT_LITERAL - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.fis. + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Fn correspondingProperty: PROPERTY name:fis visibility:public modality:FINAL [val] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .fis. declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fis type:.fis. visibility:private [final,static]' type=.fis. origin=null + RETURN type=kotlin.Nothing from='public final fun (): .Fn declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fis type:.Fn visibility:private [final,static]' type=.Fn origin=null FUN name:test visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun runConversion (f1: .Fn, f2: .Fn): kotlin.Int declared in .J' type=kotlin.Int origin=null $this: GET_VAR 'j: .J declared in .test' type=.J origin=null - f1: CALL 'public final fun (): .fsi. declared in ' type=.fsi. origin=GET_PROPERTY + f1: CALL 'public final fun (): .Fn declared in ' type=.Fn origin=GET_PROPERTY f2: TYPE_OP type=.Fn origin=SAM_CONVERSION typeOperand=.Fn FUN_EXPR type=kotlin.Function3 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (s:kotlin.String, i:kotlin.Int, ti:kotlin.Int) returnType:kotlin.String @@ -161,4 +161,4 @@ FILE fqName: fileName:/partialSam.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (s: kotlin.String, i: kotlin.Int, ts: kotlin.String): kotlin.Int declared in .test' CONST Int type=kotlin.Int value=1 - f2: CALL 'public final fun (): .fis. declared in ' type=.fis. origin=GET_PROPERTY + f2: CALL 'public final fun (): .Fn declared in ' type=.Fn origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt index 7d36f7d63c0..9c268ce684a 100644 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt @@ -68,11 +68,11 @@ FILE fqName: fileName:/multipleThisReferences.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null - FUN name:test visibility:public modality:FINAL <> ($this:.Host, $receiver:.Outer) returnType:.Host.test. + FUN name:test visibility:public modality:FINAL <> ($this:.Host, $receiver:.Outer) returnType:.Outer.Inner $this: VALUE_PARAMETER name: type:.Host $receiver: VALUE_PARAMETER name: type:.Outer BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (): .Host.test. declared in .Host' + RETURN type=kotlin.Nothing from='public final fun test (): .Outer.Inner declared in .Host' BLOCK type=.Host.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.test. diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt index 95cf7d7ba8e..7fb309c1cbc 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt @@ -63,10 +63,10 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test visibility:public modality:FINAL <> ($receiver:.Outer) returnType:.test. + FUN name:test visibility:public modality:FINAL <> ($receiver:.Outer) returnType:.Outer.Inner $receiver: VALUE_PARAMETER name: type:.Outer BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (): .test. declared in ' + RETURN type=kotlin.Nothing from='public final fun test (): .Outer.Inner declared in ' BLOCK type=.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test.