diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.txt index 7477238af4c..3ade51617c5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.txt @@ -42,18 +42,18 @@ FILE: delegateInference.kt public final var x: R|kotlin/Boolean|by R|/FreezableVar.FreezableVar|(Boolean(true)) public get(): R|kotlin/Boolean| { - ^ D|/Test.x|.R|FakeOverride|(this@R|/Test|, ::R|/Test.x|) + ^ this@R|/Test|.D|/Test.x|.R|FakeOverride|(this@R|/Test|, ::R|/Test.x|) } public set(: R|kotlin/Boolean|): R|kotlin/Unit| { - D|/Test.x|.R|FakeOverride|(this@R|/Test|, ::R|/Test.x|, R|/x|) + this@R|/Test|.D|/Test.x|.R|FakeOverride|(this@R|/Test|, ::R|/Test.x|, R|/x|) } public final var y: R|kotlin/String|by R|/FreezableVar.FreezableVar|(String()) public get(): R|kotlin/String| { - ^ D|/Test.y|.R|FakeOverride|(this@R|/Test|, ::R|/Test.y|) + ^ this@R|/Test|.D|/Test.y|.R|FakeOverride|(this@R|/Test|, ::R|/Test.y|) } public set(: R|kotlin/String|): R|kotlin/Unit| { - D|/Test.y|.R|FakeOverride|(this@R|/Test|, ::R|/Test.y|, R|/y|) + this@R|/Test|.D|/Test.y|.R|FakeOverride|(this@R|/Test|, ::R|/Test.y|, R|/y|) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.txt index c6caf41b225..df942a37af9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.txt @@ -37,7 +37,7 @@ FILE: delegateWithLambda.kt } ) public get(): R|kotlin/String| { - ^ D|/Test.x|.R|FakeOverride|(this@R|/Test|, ::R|/Test.x|) + ^ this@R|/Test|.D|/Test.x|.R|FakeOverride|(this@R|/Test|, ::R|/Test.x|) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.txt index cee40e52d3e..3e0eb65efa5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.txt @@ -40,7 +40,7 @@ FILE: provideDelegate.kt public final val x: R|kotlin/Int|by R|/delegate|(Int(1)).R|FakeOverride|>|(this@R|/A|, ::R|/A.x|) public get(): R|kotlin/Int| { - ^ D|/A.x|.R|FakeOverride|(this@R|/A|, ::R|/A.x|) + ^ this@R|/A|.D|/A.x|.R|FakeOverride|(this@R|/A|, ::R|/A.x|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.txt index f1489c4106f..7fb7ecf5fea 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.txt @@ -35,10 +35,10 @@ FILE: delegateTypeMismatch.kt public final var classifierNamePolicy: R|ClassifierNamePolicy|by this@R|/A|.R|/A.property|(Q|ClassifierNamePolicy.SOURCE_CODE_QUALIFIED|) public get(): R|ClassifierNamePolicy| { - ^ D|/A.classifierNamePolicy|.R|FakeOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|) + ^ this@R|/A|.D|/A.classifierNamePolicy|.R|FakeOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|) } public set(: R|ClassifierNamePolicy|): R|kotlin/Unit| { - D|/A.classifierNamePolicy|.R|FakeOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|, R|/classifierNamePolicy|) + this@R|/A|.D|/A.classifierNamePolicy|.R|FakeOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|, R|/classifierNamePolicy|) } public final var typeNormalizer: R|(KotlinType) -> KotlinType|by this@R|/A|.R|/A.property| KotlinType|>(property@fun (it: R|KotlinType|): R|KotlinType| { @@ -46,10 +46,10 @@ FILE: delegateTypeMismatch.kt } ) public get(): R|(KotlinType) -> KotlinType| { - ^ D|/A.typeNormalizer|.R|FakeOverride KotlinType|>|(this@R|/A|, ::R|/A.typeNormalizer|) + ^ this@R|/A|.D|/A.typeNormalizer|.R|FakeOverride KotlinType|>|(this@R|/A|, ::R|/A.typeNormalizer|) } public set(: R|(KotlinType) -> KotlinType|): R|kotlin/Unit| { - D|/A.typeNormalizer|.R|FakeOverride|(this@R|/A|, ::R|/A.typeNormalizer|, R|/typeNormalizer|) + this@R|/A|.D|/A.typeNormalizer|.R|FakeOverride|(this@R|/A|, ::R|/A.typeNormalizer|, R|/typeNormalizer|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot index 8012d258f22..170427072bd 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot @@ -124,7 +124,7 @@ digraph delegateWithAnonymousObject_kt { 50 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; 51 [label="Access variable this@R|/IssuesListUserProfile|"]; 52 [label="Access variable R|/issueListView|"]; - 53 [label="Function call: D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(...)"]; + 53 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(...)"]; 49 [label="Exit function setter" style="filled" fillcolor=red]; } subgraph cluster_13 { @@ -132,8 +132,8 @@ digraph delegateWithAnonymousObject_kt { 41 [label="Enter function getter" style="filled" fillcolor=red]; 43 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; 44 [label="Access variable this@R|/IssuesListUserProfile|"]; - 45 [label="Function call: D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(...)"]; - 46 [label="Jump: ^ D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; + 45 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(...)"]; + 46 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; 47 [label="Stub" style="filled" fillcolor=gray]; 42 [label="Exit function getter" style="filled" fillcolor=red]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.txt index b4978726f32..1d7c01dbf97 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.txt @@ -41,10 +41,10 @@ FILE: delegateWithAnonymousObject.kt } ) public get(): R|IssueListView| { - ^ D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|) + ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|) } public set(: R|IssueListView|): R|kotlin/Unit| { - D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|/issueListView|) + this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|/issueListView|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.txt index ae321287357..29b661977dc 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.txt @@ -15,10 +15,10 @@ FILE: propertyWithFunctionalType.kt } ) public get(): R|(B) -> B| { - ^ D|/A.conventer|.R|FakeOverride B|>|(this@R|/A|, ::R|/A.conventer|) + ^ this@R|/A|.D|/A.conventer|.R|FakeOverride B|>|(this@R|/A|, ::R|/A.conventer|) } public set(: R|(B) -> B|): R|kotlin/Unit| { - D|/A.conventer|.R|FakeOverride|(this@R|/A|, ::R|/A.conventer|, R|/conventer|) + this@R|/A|.D|/A.conventer|.R|FakeOverride|(this@R|/A|, ::R|/A.conventer|, R|/conventer|) } public final var conventerWithExpectedType: R|(B) -> B|by this@R|/A|.R|/A.property| B|>(property@fun (it: R|B|): R|B| { @@ -26,10 +26,10 @@ FILE: propertyWithFunctionalType.kt } ) public get(): R|(B) -> B| { - ^ D|/A.conventerWithExpectedType|.R|FakeOverride B|>|(this@R|/A|, ::R|/A.conventerWithExpectedType|) + ^ this@R|/A|.D|/A.conventerWithExpectedType|.R|FakeOverride B|>|(this@R|/A|, ::R|/A.conventerWithExpectedType|) } public set(: R|(B) -> B|): R|kotlin/Unit| { - D|/A.conventerWithExpectedType|.R|FakeOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|, R|/conventerWithExpectedType|) + this@R|/A|.D|/A.conventerWithExpectedType|.R|FakeOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|, R|/conventerWithExpectedType|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.txt index c4019f42bea..a99b5c2abfb 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.txt @@ -9,10 +9,10 @@ FILE: simpleDelegatedToMap.kt public final var foo: by R|/map| public get(): { - ^ D|/C.foo|.#(this@R|/C|, ::R|/C.foo|) + ^ this@R|/C|.D|/C.foo|.#(this@R|/C|, ::R|/C.foo|) } public set(: ): R|kotlin/Unit| { - D|/C.foo|.#(this@R|/C|, ::R|/C.foo|, R|/foo|) + this@R|/C|.D|/C.foo|.#(this@R|/C|, ::R|/C.foo|, R|/foo|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/simpleLazy.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/simpleLazy.txt index 487c6662c52..cf5443addd3 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/simpleLazy.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/simpleLazy.txt @@ -24,7 +24,7 @@ FILE: simpleLazy.kt } ) public get(): R|kotlin/String| { - ^ D|/Some.z|.R|kotlin/getValue|(this@R|/Some|, ::R|/Some.z|) + ^ this@R|/Some|.D|/Some.z|.R|kotlin/getValue|(this@R|/Some|, ::R|/Some.z|) } public final fun foo(): R|kotlin/Unit| { diff --git a/compiler/fir/raw-fir/fir-common/src/org/jetbrains/kotlin/fir/builder/ConversionUtils.kt b/compiler/fir/raw-fir/fir-common/src/org/jetbrains/kotlin/fir/builder/ConversionUtils.kt index e6c5e3819c2..b52a12395db 100644 --- a/compiler/fir/raw-fir/fir-common/src/org/jetbrains/kotlin/fir/builder/ConversionUtils.kt +++ b/compiler/fir/raw-fir/fir-common/src/org/jetbrains/kotlin/fir/builder/ConversionUtils.kt @@ -11,29 +11,22 @@ import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.declarations.FirProperty import org.jetbrains.kotlin.fir.declarations.FirVariable -import org.jetbrains.kotlin.fir.declarations.builder.FirPropertyBuilder -import org.jetbrains.kotlin.fir.declarations.builder.buildProperty -import org.jetbrains.kotlin.fir.declarations.builder.buildPropertyAccessor -import org.jetbrains.kotlin.fir.declarations.builder.buildValueParameter +import org.jetbrains.kotlin.fir.declarations.builder.* import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor import org.jetbrains.kotlin.fir.expressions.* import org.jetbrains.kotlin.fir.expressions.builder.* import org.jetbrains.kotlin.fir.expressions.impl.FirSingleExpressionBlock import org.jetbrains.kotlin.fir.expressions.impl.buildSingleExpressionBlock -import org.jetbrains.kotlin.fir.references.builder.buildDelegateFieldReference -import org.jetbrains.kotlin.fir.references.builder.buildExplicitThisReference -import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference -import org.jetbrains.kotlin.fir.references.builder.buildSimpleNamedReference +import org.jetbrains.kotlin.fir.references.builder.* import org.jetbrains.kotlin.fir.symbols.StandardClassIds -import org.jetbrains.kotlin.fir.symbols.impl.FirDelegateFieldSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirPropertyAccessorSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol +import org.jetbrains.kotlin.fir.symbols.constructStarProjectedType +import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.ConeStarProjection import org.jetbrains.kotlin.fir.types.FirTypeRef import org.jetbrains.kotlin.fir.types.FirUserTypeRef import org.jetbrains.kotlin.fir.types.builder.buildImplicitTypeRef +import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.types.builder.buildTypeProjectionWithVariance import org.jetbrains.kotlin.fir.types.builder.buildUserTypeRef import org.jetbrains.kotlin.fir.types.impl.* @@ -298,31 +291,52 @@ fun generateTemporaryVariable( fun FirPropertyBuilder.generateAccessorsByDelegate( delegateBuilder: FirWrappedDelegateExpressionBuilder?, + ownerClassBuilder: FirClassBuilder?, session: FirSession, - member: Boolean, - extension: Boolean, + isExtension: Boolean, stubMode: Boolean, receiver: FirExpression? - ) { if (delegateBuilder == null) return val delegateFieldSymbol = FirDelegateFieldSymbol(symbol.callableId).also { this.delegateFieldSymbol = it } + val ownerSymbol = when (ownerClassBuilder) { + is FirAnonymousObjectBuilder -> ownerClassBuilder.symbol + is AbstractFirRegularClassBuilder -> ownerClassBuilder.symbol + else -> null + } + val isMember = ownerSymbol != null + + fun thisRef(): FirExpression = + when { + ownerSymbol != null -> buildThisReceiverExpression { + source = delegateBuilder.source + calleeReference = buildImplicitThisReference { + boundSymbol = ownerSymbol + } + typeRef = buildResolvedTypeRef { + val typeParameterNumber = (ownerClassBuilder as? AbstractFirRegularClassBuilder)?.typeParameters?.size ?: 0 + type = ownerSymbol.constructStarProjectedType(typeParameterNumber) + } + } + // ??? + isExtension -> buildQualifiedAccessExpression { + source = delegateBuilder.source + calleeReference = buildExplicitThisReference {} + } + else -> buildConstExpression(null, FirConstKind.Null, null) + } fun delegateAccess() = buildQualifiedAccessExpression { source = delegateBuilder.source calleeReference = buildDelegateFieldReference { resolvedSymbol = delegateFieldSymbol } - } - - fun thisRef(): FirExpression = - if (member || extension) buildQualifiedAccessExpression { - source = delegateBuilder.source - calleeReference = buildExplicitThisReference {} + if (ownerSymbol != null) { + dispatchReceiver = thisRef() } - else buildConstExpression(null, FirConstKind.Null, null) + } val isVar = this@generateAccessorsByDelegate.isVar fun propertyRef() = buildCallableReferenceAccess { @@ -333,12 +347,12 @@ fun FirPropertyBuilder.generateAccessorsByDelegate( resolvedSymbol = this@generateAccessorsByDelegate.symbol } typeRef = when { - !member && !extension -> if (isVar) { + !isMember && !isExtension -> if (isVar) { FirImplicitKMutableProperty0TypeRef(null, ConeStarProjection) } else { FirImplicitKProperty0TypeRef(null, ConeStarProjection) } - member && extension -> if (isVar) { + isMember && isExtension -> if (isVar) { FirImplicitKMutableProperty2TypeRef(null, ConeStarProjection, ConeStarProjection, ConeStarProjection) } else { FirImplicitKProperty2TypeRef(null, ConeStarProjection, ConeStarProjection, ConeStarProjection) diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt index 5dd9a24122a..86fda180efb 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt @@ -429,12 +429,13 @@ class DeclarationsConverter( val secondaryConstructors = classBody.getChildNodesByType(SECONDARY_CONSTRUCTOR) val classWrapper = ClassWrapper( - className, modifiers, classKind, primaryConstructor != null, - secondaryConstructors.isNotEmpty(), - if (primaryConstructor != null) !primaryConstructor!!.hasValueParameters() + className, modifiers, classKind, classBuilder, + hasPrimaryConstructor = primaryConstructor != null, + hasSecondaryConstructor = secondaryConstructors.isNotEmpty(), + hasDefaultConstructor = if (primaryConstructor != null) !primaryConstructor!!.hasValueParameters() else secondaryConstructors.isEmpty() || secondaryConstructors.any { !it.hasValueParameters() }, - selfType, - delegatedSuperTypeRef ?: defaultDelegatedSuperTypeRef, superTypeCallEntry + delegatedSelfTypeRef = selfType, + delegatedSuperTypeRef = delegatedSuperTypeRef ?: defaultDelegatedSuperTypeRef, superTypeCallEntry = superTypeCallEntry ) //parse primary constructor val primaryConstructorWrapper = convertPrimaryConstructor(primaryConstructor, classWrapper, delegatedConstructorSource) @@ -517,7 +518,8 @@ class DeclarationsConverter( typeRef = delegatedSelfType val classWrapper = ClassWrapper( - SpecialNames.NO_NAME_PROVIDED, modifiers, ClassKind.OBJECT, hasPrimaryConstructor = false, + SpecialNames.NO_NAME_PROVIDED, modifiers, ClassKind.OBJECT, this, + hasPrimaryConstructor = false, hasSecondaryConstructor = classBody.getChildNodesByType(SECONDARY_CONSTRUCTOR).isNotEmpty(), hasDefaultConstructor = false, delegatedSelfTypeRef = delegatedSelfType, @@ -576,7 +578,8 @@ class DeclarationsConverter( symbol = FirAnonymousObjectSymbol() annotations += modifiers.annotations val enumClassWrapper = ClassWrapper( - enumEntryName, modifiers, ClassKind.ENUM_ENTRY, hasPrimaryConstructor = true, + enumEntryName, modifiers, ClassKind.ENUM_ENTRY, this, + hasPrimaryConstructor = true, hasSecondaryConstructor = classBodyNode.getChildNodesByType(SECONDARY_CONSTRUCTOR).isNotEmpty(), hasDefaultConstructor = false, delegatedSelfTypeRef = buildResolvedTypeRef { @@ -623,7 +626,7 @@ class DeclarationsConverter( ENUM_ENTRY -> container += convertEnumEntry(node, classWrapper) CLASS -> container += convertClass(node) FUN -> container += convertFunctionDeclaration(node) - PROPERTY -> container += convertPropertyDeclaration(node) + PROPERTY -> container += convertPropertyDeclaration(node, classWrapper) TYPEALIAS -> container += convertTypeAlias(node) OBJECT_DECLARATION -> container += convertClass(node) CLASS_INITIALIZER -> container += convertAnonymousInitializer(node) //anonymousInitializer @@ -820,7 +823,7 @@ class DeclarationsConverter( /** * @see org.jetbrains.kotlin.parsing.KotlinParsing.parseProperty */ - fun convertPropertyDeclaration(property: LighterASTNode): FirDeclaration { + fun convertPropertyDeclaration(property: LighterASTNode, classWrapper: ClassWrapper? = null): FirDeclaration { var modifiers = Modifier() var identifier: String? = null val firTypeParameters = mutableListOf() @@ -884,9 +887,9 @@ class DeclarationsConverter( } generateAccessorsByDelegate( delegateBuilder, + classWrapper?.classBuilder, baseSession, - member = false, - extension = false, + isExtension = false, stubMode, receiver ) @@ -916,9 +919,10 @@ class DeclarationsConverter( expressionConverter.getAsFirExpression(it, "Should have delegate") } generateAccessorsByDelegate( - delegateBuilder, baseSession, - member = parentNode?.tokenType != KT_FILE, - extension = receiverType != null, + delegateBuilder, + classWrapper?.classBuilder, + baseSession, + isExtension = receiverType != null, stubMode, receiver ) diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/ClassWrapper.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/ClassWrapper.kt index aa98e5e32e3..31a0e86ee5e 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/ClassWrapper.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/ClassWrapper.kt @@ -9,8 +9,10 @@ import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.fir.declarations.builder.FirClassBuilder import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.lightTree.fir.modifier.Modifier +import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.types.FirTypeRef import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames @@ -19,12 +21,13 @@ class ClassWrapper( private val className: Name, private val modifiers: Modifier, private val classKind: ClassKind, + val classBuilder: FirClassBuilder, val hasPrimaryConstructor: Boolean, val hasSecondaryConstructor: Boolean, val hasDefaultConstructor: Boolean, val delegatedSelfTypeRef: FirTypeRef, val delegatedSuperTypeRef: FirTypeRef, - val superTypeCallEntry: MutableList + val superTypeCallEntry: MutableList, ) { fun isObjectLiteral(): Boolean { return className == SpecialNames.NO_NAME_PROVIDED && isObject() diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index e21db5596ee..9fb832e2062 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -156,7 +156,8 @@ class RawFirBuilder( convert() private fun KtDeclaration.toFirDeclaration( - delegatedSuperType: FirTypeRef, delegatedSelfType: FirResolvedTypeRef, owner: KtClassOrObject, hasPrimaryConstructor: Boolean, + delegatedSuperType: FirTypeRef, delegatedSelfType: FirResolvedTypeRef, + owner: KtClassOrObject, ownerClassBuilder: FirClassBuilder, hasPrimaryConstructor: Boolean, ): FirDeclaration { return when (this) { is KtSecondaryConstructor -> { @@ -175,6 +176,9 @@ class RawFirBuilder( } toFirEnumEntry(delegatedSelfType, ownerClassHasDefaultConstructor) } + is KtProperty -> { + toFirProperty(ownerClassBuilder) + } else -> convert() } } @@ -588,6 +592,7 @@ class RawFirBuilder( correctedEnumSelfTypeRef, delegatedSelfType = delegatedEntrySelfType, ktEnumEntry, + ownerClassBuilder = this, hasPrimaryConstructor = true, ) } @@ -651,7 +656,8 @@ class RawFirBuilder( for (declaration in classOrObject.declarations) { addDeclaration( declaration.toFirDeclaration( - delegatedSuperType, delegatedSelfType, classOrObject, hasPrimaryConstructor = primaryConstructor != null, + delegatedSuperType, delegatedSelfType, classOrObject, classBuilder, + hasPrimaryConstructor = primaryConstructor != null, ), ) } @@ -696,6 +702,7 @@ class RawFirBuilder( delegatedSuperType, delegatedSelfType, owner = objectDeclaration, + ownerClassBuilder = this, hasPrimaryConstructor = false, ) } @@ -923,23 +930,15 @@ class RawFirBuilder( } } - override fun visitAnonymousInitializer(initializer: KtAnonymousInitializer, data: Unit): FirElement { - return buildAnonymousInitializer { - source = initializer.toFirSourceElement() - session = baseSession - body = if (stubMode) buildEmptyExpressionBlock() else initializer.body.toFirBlock() - } - } - - override fun visitProperty(property: KtProperty, data: Unit): FirElement { - val propertyType = property.typeReference.toFirOrImplicitType() - val propertyName = property.nameAsSafeName - val isVar = property.isVar - val propertyInitializer = if (property.hasInitializer()) { - { property.initializer }.toFirExpression("Should have initializer") + private fun KtProperty.toFirProperty(ownerClassBuilder: FirClassBuilder?): FirProperty { + val propertyType = typeReference.toFirOrImplicitType() + val propertyName = nameAsSafeName + val isVar = isVar + val propertyInitializer = if (hasInitializer()) { + { initializer }.toFirExpression("Should have initializer") } else null - val delegateExpression by lazy { property.delegate?.expression } - val propertySource = property.toFirSourceElement() + val delegateExpression by lazy { delegate?.expression } + val propertySource = toFirSourceElement() return buildProperty { source = propertySource @@ -949,7 +948,7 @@ class RawFirBuilder( this.isVar = isVar initializer = propertyInitializer - if (property.isLocal) { + if (this@toFirProperty.isLocal) { isLocal = true symbol = FirPropertySymbol(propertyName) val delegateBuilder = delegateExpression?.let { @@ -962,43 +961,57 @@ class RawFirBuilder( status = FirDeclarationStatusImpl(Visibilities.LOCAL, Modality.FINAL) val receiver = delegateExpression?.toFirExpression("Incorrect delegate expression") - generateAccessorsByDelegate(delegateBuilder, baseSession, member = false, extension = false, stubMode, receiver) + generateAccessorsByDelegate(delegateBuilder, null, baseSession, isExtension = false, stubMode, receiver) } else { isLocal = false - receiverTypeRef = property.receiverTypeReference.convertSafe() + receiverTypeRef = receiverTypeReference.convertSafe() symbol = FirPropertySymbol(callableIdForName(propertyName)) - val delegateBuilder = if (property.hasDelegate()) { + val delegateBuilder = if (hasDelegate()) { FirWrappedDelegateExpressionBuilder().apply { source = if (stubMode) null else delegateExpression?.toFirSourceElement() expression = { delegateExpression }.toFirExpression("Should have delegate") } } else null - status = FirDeclarationStatusImpl(property.visibility, property.modality).apply { - isExpect = property.hasExpectModifier() - isActual = property.hasActualModifier() - isOverride = property.hasModifier(OVERRIDE_KEYWORD) - isConst = property.hasModifier(CONST_KEYWORD) - isLateInit = property.hasModifier(LATEINIT_KEYWORD) + status = FirDeclarationStatusImpl(visibility, modality).apply { + isExpect = hasExpectModifier() + isActual = hasActualModifier() + isOverride = hasModifier(OVERRIDE_KEYWORD) + isConst = hasModifier(CONST_KEYWORD) + isLateInit = hasModifier(LATEINIT_KEYWORD) } - property.extractTypeParametersTo(this) + extractTypeParametersTo(this) - getter = property.getter.toFirPropertyAccessor(property, propertyType, isGetter = true) - setter = if (isVar) property.setter.toFirPropertyAccessor(property, propertyType, isGetter = false) else null + getter = this@toFirProperty.getter.toFirPropertyAccessor(this@toFirProperty, propertyType, isGetter = true) + setter = if (isVar) { + this@toFirProperty.setter.toFirPropertyAccessor(this@toFirProperty, propertyType, isGetter = false) + } else null val receiver = delegateExpression?.toFirExpression("Should have delegate") generateAccessorsByDelegate( delegateBuilder, + ownerClassBuilder, baseSession, - member = !property.isTopLevel, - extension = property.receiverTypeReference != null, + isExtension = receiverTypeReference != null, stubMode, receiver ) } - property.extractAnnotationsTo(this) + extractAnnotationsTo(this) } } + override fun visitAnonymousInitializer(initializer: KtAnonymousInitializer, data: Unit): FirElement { + return buildAnonymousInitializer { + source = initializer.toFirSourceElement() + session = baseSession + body = if (stubMode) buildEmptyExpressionBlock() else initializer.body.toFirBlock() + } + } + + override fun visitProperty(property: KtProperty, data: Unit): FirElement { + return property.toFirProperty(ownerClassBuilder = null) + } + override fun visitTypeReference(typeReference: KtTypeReference, data: Unit): FirElement { val typeElement = typeReference.typeElement val source = typeReference.toFirSourceElement() diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/symbols/SymbolUtils.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/symbols/SymbolUtils.kt new file mode 100644 index 00000000000..fda7c77b46e --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/symbols/SymbolUtils.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.symbols + +import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl +import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLookupTagWithFixedSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol +import org.jetbrains.kotlin.fir.types.ConeClassLikeType +import org.jetbrains.kotlin.fir.types.ConeStarProjection +import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl + +fun FirClassSymbol<*>.constructStarProjectedType(typeParameterNumber: Int): ConeClassLikeType { + return ConeClassLikeTypeImpl( + if (classId.isLocal) ConeClassLookupTagWithFixedSymbol(classId, this) + else ConeClassLikeLookupTagImpl(classId), + Array(typeParameterNumber) { ConeStarProjection }, + isNullable = false + ) +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/callableReference/property/delegated.kt b/compiler/testData/codegen/box/callableReference/property/delegated.kt index e9598aee44c..00b880be84e 100644 --- a/compiler/testData/codegen/box/callableReference/property/delegated.kt +++ b/compiler/testData/codegen/box/callableReference/property/delegated.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty val four: Int by NumberDecrypter diff --git a/compiler/testData/codegen/box/delegatedProperty/beforeDeclarationContainerOptimization.kt b/compiler/testData/codegen/box/delegatedProperty/beforeDeclarationContainerOptimization.kt index cec3e858552..662c2d3b8f3 100644 --- a/compiler/testData/codegen/box/delegatedProperty/beforeDeclarationContainerOptimization.kt +++ b/compiler/testData/codegen/box/delegatedProperty/beforeDeclarationContainerOptimization.kt @@ -1,5 +1,4 @@ // !API_VERSION: 1.3 -// IGNORE_BACKEND_FIR: JVM_IR // This test simply checks that we still generate correct calls to PropertyReference1Impl constructors for API version < 1.4, // where we added and started using new constructors which take j.l.Class+int instead of KDeclarationContainer. diff --git a/compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt b/compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt index a54f39048c3..3c03bc94ca8 100644 --- a/compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt +++ b/compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/castGetReturnType.kt b/compiler/testData/codegen/box/delegatedProperty/castGetReturnType.kt index 1e502c79a8d..cc106890792 100644 --- a/compiler/testData/codegen/box/delegatedProperty/castGetReturnType.kt +++ b/compiler/testData/codegen/box/delegatedProperty/castGetReturnType.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/castSetParameter.kt b/compiler/testData/codegen/box/delegatedProperty/castSetParameter.kt index fbae4b52c60..3d3e7a7806a 100644 --- a/compiler/testData/codegen/box/delegatedProperty/castSetParameter.kt +++ b/compiler/testData/codegen/box/delegatedProperty/castSetParameter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateAsInnerClass.kt b/compiler/testData/codegen/box/delegatedProperty/delegateAsInnerClass.kt index 68401ae752a..9b503ccce83 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateAsInnerClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateAsInnerClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateByOtherProperty.kt b/compiler/testData/codegen/box/delegatedProperty/delegateByOtherProperty.kt index 2a3784573d5..7ec7f0c9151 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateByOtherProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateByOtherProperty.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelFun.kt b/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelFun.kt index 9e042fd7ccb..5900d71c985 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelFun.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelFun.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelProperty.kt b/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelProperty.kt index 5d9c75af2bf..22f7b1b2ed3 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelProperty.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateWithPrivateSet.kt b/compiler/testData/codegen/box/delegatedProperty/delegateWithPrivateSet.kt index fc23642695d..0419be41898 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateWithPrivateSet.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateWithPrivateSet.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME // See KT-10107: 'Variable must be initialized' for delegate with private set diff --git a/compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt b/compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt index 7d60f6c0f30..f1072a6c339 100644 --- a/compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt +++ b/compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate(var inner: T) { diff --git a/compiler/testData/codegen/box/delegatedProperty/genericDelegateUncheckedCast1.kt b/compiler/testData/codegen/box/delegatedProperty/genericDelegateUncheckedCast1.kt index b90b8c2cca1..fbc9e989d67 100644 --- a/compiler/testData/codegen/box/delegatedProperty/genericDelegateUncheckedCast1.kt +++ b/compiler/testData/codegen/box/delegatedProperty/genericDelegateUncheckedCast1.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt b/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt index 6d54996f656..c08af8aeca2 100644 --- a/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt +++ b/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFunInClass.kt b/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFunInClass.kt index 5dc3739b112..653c844066e 100644 --- a/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFunInClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFunInClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/inClassVal.kt b/compiler/testData/codegen/box/delegatedProperty/inClassVal.kt index 10bed7d5b5c..0878fe18868 100644 --- a/compiler/testData/codegen/box/delegatedProperty/inClassVal.kt +++ b/compiler/testData/codegen/box/delegatedProperty/inClassVal.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/inClassVar.kt b/compiler/testData/codegen/box/delegatedProperty/inClassVar.kt index 0bb73c08907..4541763a721 100644 --- a/compiler/testData/codegen/box/delegatedProperty/inClassVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/inClassVar.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/inTrait.kt b/compiler/testData/codegen/box/delegatedProperty/inTrait.kt index 977f6bfde4c..10a1746e561 100644 --- a/compiler/testData/codegen/box/delegatedProperty/inTrait.kt +++ b/compiler/testData/codegen/box/delegatedProperty/inTrait.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/insideInlinedObjectMultiModule.kt b/compiler/testData/codegen/box/delegatedProperty/insideInlinedObjectMultiModule.kt index be3f007a202..6ef7c86a3b8 100644 --- a/compiler/testData/codegen/box/delegatedProperty/insideInlinedObjectMultiModule.kt +++ b/compiler/testData/codegen/box/delegatedProperty/insideInlinedObjectMultiModule.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // MODULE: lib // FILE: lib.kt diff --git a/compiler/testData/codegen/box/delegatedProperty/kt4138.kt b/compiler/testData/codegen/box/delegatedProperty/kt4138.kt index 27c2695bdaf..f4535dd82e7 100644 --- a/compiler/testData/codegen/box/delegatedProperty/kt4138.kt +++ b/compiler/testData/codegen/box/delegatedProperty/kt4138.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate(var inner: T) { diff --git a/compiler/testData/codegen/box/delegatedProperty/kt6722.kt b/compiler/testData/codegen/box/delegatedProperty/kt6722.kt index 6d802360eb5..f680293e6dc 100644 --- a/compiler/testData/codegen/box/delegatedProperty/kt6722.kt +++ b/compiler/testData/codegen/box/delegatedProperty/kt6722.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME interface T { diff --git a/compiler/testData/codegen/box/delegatedProperty/kt9712.kt b/compiler/testData/codegen/box/delegatedProperty/kt9712.kt index 6f1715a9abc..585489f7886 100644 --- a/compiler/testData/codegen/box/delegatedProperty/kt9712.kt +++ b/compiler/testData/codegen/box/delegatedProperty/kt9712.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/delegatedProperty/privateVar.kt b/compiler/testData/codegen/box/delegatedProperty/privateVar.kt index 0770a9ad843..33faef3e3b1 100644 --- a/compiler/testData/codegen/box/delegatedProperty/privateVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/privateVar.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/protectedVarWithPrivateSet.kt b/compiler/testData/codegen/box/delegatedProperty/protectedVarWithPrivateSet.kt index 1a818f68c88..8d30ddd5d2b 100644 --- a/compiler/testData/codegen/box/delegatedProperty/protectedVarWithPrivateSet.kt +++ b/compiler/testData/codegen/box/delegatedProperty/protectedVarWithPrivateSet.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/hostCheck.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/hostCheck.kt index 49ddd042327..788f19e57d0 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/hostCheck.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/hostCheck.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate(val value: String) { diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt index 304d23f96d3..e1456a8bd0f 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt index e084a11f955..90ce4a199e4 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // TARGET_BACKEND: JVM diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt16441.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt16441.kt index 86680f9d055..1e93734c254 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt16441.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt16441.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt18902.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt18902.kt index 87905d7721d..9b20ca39800 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt18902.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt18902.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.properties.ReadOnlyProperty diff --git a/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt b/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt index 3c85a0712cf..69924d135ff 100644 --- a/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt +++ b/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFunInClass.kt b/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFunInClass.kt index 1679828426f..ef2ddccf0f6 100644 --- a/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFunInClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFunInClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/twoPropByOneDelegete.kt b/compiler/testData/codegen/box/delegatedProperty/twoPropByOneDelegete.kt index 9832ba43010..d73aadaf604 100644 --- a/compiler/testData/codegen/box/delegatedProperty/twoPropByOneDelegete.kt +++ b/compiler/testData/codegen/box/delegatedProperty/twoPropByOneDelegete.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate(val f: (T) -> Int) { diff --git a/compiler/testData/codegen/box/delegatedProperty/valInInnerClass.kt b/compiler/testData/codegen/box/delegatedProperty/valInInnerClass.kt index 09b28385bfb..43cda384acc 100644 --- a/compiler/testData/codegen/box/delegatedProperty/valInInnerClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/valInInnerClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/delegatedProperty/varInInnerClass.kt b/compiler/testData/codegen/box/delegatedProperty/varInInnerClass.kt index 43a7c1fa38f..4b99bb19003 100644 --- a/compiler/testData/codegen/box/delegatedProperty/varInInnerClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/varInInnerClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt index cb0aa1176c5..8cfad98309d 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR class Foo { var a: Int = 42 diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt index aab22448a56..31533f625a6 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateClassVarToInlineClassWithProvideDelegate.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR class Foo { var a: Int = 42 diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt index 3d4e5c6556f..0d8d8c78f4b 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateCompanionVarToInlineClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR class Foo { companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt index a4a7a99be16..1c053910261 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateJvmStaticCompanionVarToInlineClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt index faac494cc75..64880c7ee7a 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegateObjectVarToInlineClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR object Foo { var a: Int = 42 diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt index 9d942ae177e..386a83b8246 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/delegatePrivateCompanionVarToInlineClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR class Foo { companion object { diff --git a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt index 6e703a05986..17ac0d3d836 100644 --- a/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt +++ b/compiler/testData/codegen/box/inlineClasses/propertyDelegation/kt27070.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.properties.ReadOnlyProperty diff --git a/compiler/testData/codegen/box/properties/kt4383.kt b/compiler/testData/codegen/box/properties/kt4383.kt index ddad287e9f5..3a8d6e0a1e3 100644 --- a/compiler/testData/codegen/box/properties/kt4383.kt +++ b/compiler/testData/codegen/box/properties/kt4383.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class D { diff --git a/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt b/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt index 64439f64e7d..008ef946010 100644 --- a/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt +++ b/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Holder(var value: Int) { diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInPropertyDelegate.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInPropertyDelegate.kt index c7cb8394a05..bb87f24898b 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInPropertyDelegate.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInPropertyDelegate.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/reflection/genericSignature/genericBackingFieldSignature.kt b/compiler/testData/codegen/box/reflection/genericSignature/genericBackingFieldSignature.kt index 53f8ce50d7f..97b54f68020 100644 --- a/compiler/testData/codegen/box/reflection/genericSignature/genericBackingFieldSignature.kt +++ b/compiler/testData/codegen/box/reflection/genericSignature/genericBackingFieldSignature.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/typeMapping/kt3863.kt b/compiler/testData/codegen/box/typeMapping/kt3863.kt index 3c535f3288e..21b6b4acd63 100644 --- a/compiler/testData/codegen/box/typeMapping/kt3863.kt +++ b/compiler/testData/codegen/box/typeMapping/kt3863.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty // java.lang.VerifyError: (class: NotImplemented, method: get signature: (Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;) Unable to pop operand off an empty stack diff --git a/compiler/testData/codegen/box/unsignedTypes/kt25784.kt b/compiler/testData/codegen/box/unsignedTypes/kt25784.kt index e8cf6c408a1..41b3aa34a06 100644 --- a/compiler/testData/codegen/box/unsignedTypes/kt25784.kt +++ b/compiler/testData/codegen/box/unsignedTypes/kt25784.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt index d0dc7c9042d..3977c2aeed1 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt @@ -109,7 +109,8 @@ FILE fqName: fileName:/classLevelProperties.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue [inline,operator] declared in kotlin' type=kotlin.Int origin=null : kotlin.Int $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final]' type=kotlin.Lazy origin=null - thisRef: GET_VAR ': .C declared in .C' type=.C origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final] @@ -123,7 +124,7 @@ FILE fqName: fileName:/classLevelProperties.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - GET_VAR ': .C declared in .C' type=.C origin=null + GET_VAR ': .C declared in .C.' type=.C origin=null PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] @@ -131,7 +132,7 @@ FILE fqName: fileName:/classLevelProperties.kt VALUE_PARAMETER name: index:0 type:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - GET_VAR ': .C declared in .C' type=.C origin=null + GET_VAR ': .C declared in .C.' type=.C origin=null PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE GET_VAR ': IrErrorType declared in .C.' type=IrErrorType origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt index 5de09b19984..813289111a1 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt @@ -54,7 +54,8 @@ FILE fqName: fileName:/delegatedProperties.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue [inline,operator] declared in kotlin' type=kotlin.Int origin=null : kotlin.Int $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final]' type=kotlin.Lazy origin=null - thisRef: GET_VAR ': .C declared in .C' type=.C origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null property: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final] @@ -66,7 +67,7 @@ FILE fqName: fileName:/delegatedProperties.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - GET_VAR ': .C declared in .C' type=.C origin=null + GET_VAR ': .C declared in .C.' type=.C origin=null PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] @@ -74,7 +75,7 @@ FILE fqName: fileName:/delegatedProperties.kt VALUE_PARAMETER name: index:0 type:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - GET_VAR ': .C declared in .C' type=.C origin=null + GET_VAR ': .C declared in .C.' type=.C origin=null PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE GET_VAR ': IrErrorType declared in .C.' type=IrErrorType origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt index ca9b0a65643..7e8a32888b1 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt @@ -99,7 +99,8 @@ FILE fqName: fileName:/member.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host' CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String [operator] declared in .Delegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:testMember$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - thisRef: GET_VAR ': .Host declared in .Host' type=.Host origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + thisRef: GET_VAR ': .Host declared in .Host.' type=.Host origin=null property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty1<.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt index c42cb80b6b8..5e7a0a22b8b 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt @@ -73,8 +73,8 @@ FILE fqName: fileName:/memberExtension.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host' CALL 'public final fun getValue (receiver: kotlin.String, p: kotlin.Any): kotlin.String [operator] declared in .Host.StringDelegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:plusK$delegate type:.Host.StringDelegate visibility:private [final]' type=.Host.StringDelegate origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host - receiver: ERROR_CALL 'Unresolved reference: this@R|/Host.plusK|' type=kotlin.String + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty2<.Host, kotlin.String, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE $this: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host $receiver: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt index 79485ce4f28..dc9b081ec0f 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt @@ -262,7 +262,8 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt RETURN type=kotlin.Nothing from='public final fun (): T of . declared in .additionalText$delegate.' CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . declared in .additionalText$delegate..deepO$delegate.' type=T of . origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' type=.additionalText$delegate..deepO$delegate. origin=null - t: ERROR_CALL 'Unresolved reference: this@R|/anonymous.deepO|' type=.Value., .CR.>> + receiver: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null + t: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null p: PROPERTY_REFERENCE 'private final deepO: T of . [delegated,val]' field=null getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value., .CR.>>, .Value., .CR.>>, T of .> origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final] @@ -292,7 +293,8 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt RETURN type=kotlin.Nothing from='public final fun (): T of . declared in .additionalText$delegate.' CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . declared in .additionalText$delegate..deepK$delegate.' type=T of . origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' type=.additionalText$delegate..deepK$delegate. origin=null - t: ERROR_CALL 'Unresolved reference: this@R|/anonymous.deepK|' type=.Value., .CR.>> + receiver: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null + t: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null p: PROPERTY_REFERENCE 'private final deepK: T of . [delegated,val]' field=null getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value., .CR.>>, .Value., .CR.>>, T of .> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN name:getValue visibility:public modality:FINAL <> ($this:.additionalText$delegate., t:.Value., .CR.>>, p:kotlin.reflect.KProperty<*>) returnType:.P., T of .> $this: VALUE_PARAMETER name: type:.additionalText$delegate.