diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt index 8dd907e5aad..bbc58f4c488 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt @@ -42,7 +42,7 @@ FILE: delegateInference.kt public final var x: R|kotlin/Boolean|by R|/FreezableVar.FreezableVar|(Boolean(true)) public get(): R|kotlin/Boolean| { - ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) + ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) } public set(: R|kotlin/Boolean|): R|kotlin/Unit| { this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|, R|/x|) @@ -50,7 +50,7 @@ FILE: delegateInference.kt public final var y: R|kotlin/String|by R|/FreezableVar.FreezableVar|(String()) public get(): R|kotlin/String| { - ^ this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|) + ^ this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|) } public set(: R|kotlin/String|): R|kotlin/Unit| { this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|, R|/y|) diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.fir.txt index 52c036bc38c..622e0a907dd 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.fir.txt @@ -31,7 +31,7 @@ FILE: delegateWithLambda.kt } ) public get(): R|kotlin/String| { - ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) + ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.fir.txt index 680a7dde0fe..4cdd976fa0f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.fir.txt @@ -38,9 +38,9 @@ FILE: provideDelegate.kt super() } - public final val x: R|kotlin/Int|by R|/delegate|(Int(1)).R|SubstitutionOverride|>|(this@R|/A|, ::R|/A.x|) + public final val x: R|kotlin/Int|by R|/delegate|(Int(1)).R|SubstitutionOverride|>|(this@R|/A|, ::R|/A.x|) public get(): R|kotlin/Int| { - ^ this@R|/A|.D|/A.x|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.x|) + ^ this@R|/A|.D|/A.x|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.x|) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/receiverInference.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/receiverInference.fir.txt index 07af82957ec..2b543389953 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/receiverInference.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/receiverInference.fir.txt @@ -29,9 +29,9 @@ FILE: receiverInference.kt super() } - public final val d: R|kotlin/String|by R|/mkProp|().R|SubstitutionOverride|>|(this@R|/MyEnt|, ::R|/MyEnt.d|) + public final val d: R|kotlin/String|by R|/mkProp|().R|SubstitutionOverride|>|(this@R|/MyEnt|, ::R|/MyEnt.d|) public get(): R|kotlin/String| { - ^ this@R|/MyEnt|.D|/MyEnt.d|.R|SubstitutionOverride|(this@R|/MyEnt|, ::R|/MyEnt.d|) + ^ this@R|/MyEnt|.D|/MyEnt.d|.R|SubstitutionOverride|(this@R|/MyEnt|, ::R|/MyEnt.d|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt index d8be7b981c2..7b0db5a9c27 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt @@ -35,7 +35,7 @@ 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| { - ^ this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|) + ^ this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|) } public set(: R|ClassifierNamePolicy|): R|kotlin/Unit| { this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|, R|/classifierNamePolicy|) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot index a091d7b3d06..525fd7f4c84 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot @@ -178,8 +178,8 @@ digraph delegateWithAnonymousObject_kt { 55 [label="Enter block"]; 56 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; 57 [label="Access variable this@R|/IssuesListUserProfile|"]; - 58 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)"]; - 59 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; + 58 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)"]; + 59 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; 60 [label="Stub" style="filled" fillcolor=gray]; 61 [label="Exit block" style="filled" fillcolor=gray]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt index 2d740534f34..b16ae6fbca5 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt @@ -41,7 +41,7 @@ FILE: delegateWithAnonymousObject.kt } ) public get(): R|IssueListView| { - ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|) + ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|) } public set(: R|IssueListView|): R|kotlin/Unit| { this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|/issueListView|) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/kt41917.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/kt41917.fir.txt index 1bd9fc90095..ed85618ba3b 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/kt41917.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/kt41917.fir.txt @@ -25,12 +25,12 @@ FILE: kt41917.kt public final val implicit: R|kotlin/String|by R|/DummyDelegate.DummyDelegate|(String(hello)) public get(): R|kotlin/String| { - ^ this@R|/A|.D|/A.implicit|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.implicit|) + ^ this@R|/A|.D|/A.implicit|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.implicit|) } public final val explicit: R|kotlin/String|by R|/DummyDelegate.DummyDelegate|(String(hello)) public get(): R|kotlin/String| { - ^ this@R|/A|.D|/A.explicit|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.explicit|) + ^ this@R|/A|.D|/A.explicit|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.explicit|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/nullableTypeDelegate.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/nullableTypeDelegate.fir.txt index 99338510e24..7a76e6e75a3 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/nullableTypeDelegate.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/nullableTypeDelegate.fir.txt @@ -19,7 +19,7 @@ FILE: nullableTypeDelegate.kt public final var other: R|MyClassSome?|by this@R|/MyClassSome|.R|/directed|((Q|MyClassSome|).R|kotlin/jvm/java|) public get(): R|MyClassSome?| { - ^ this@R|/MyClassSome|.D|/MyClassSome.other|.R|SubstitutionOverride|(this@R|/MyClassSome|, ::R|/MyClassSome.other|) + ^ this@R|/MyClassSome|.D|/MyClassSome.other|.R|SubstitutionOverride|(this@R|/MyClassSome|, ::R|/MyClassSome.other|) } public set(: R|MyClassSome?|): R|kotlin/Unit| { this@R|/MyClassSome|.D|/MyClassSome.other|.R|SubstitutionOverride|(this@R|/MyClassSome|, ::R|/MyClassSome.other|, R|/other|) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt index 0b633af3a4a..e96f55ce057 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt @@ -26,7 +26,7 @@ FILE: propertyWithFunctionalType.kt } ) public get(): R|(B) -> B| { - ^ this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|) + ^ this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|) } public set(: R|(B) -> B|): R|kotlin/Unit| { this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|, R|/conventerWithExpectedType|) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt index 6098bc2af0e..c501d5a7770 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt @@ -30,14 +30,14 @@ FILE: hideBySeverity.kt super() } - public final val hideBySeverityDerived: R|kotlin/collections/MutableSet|by this@R|/Some|.R|/BaseState.propertyDerived||>(R|kotlin/collections/mutableSetOf|()).R|SubstitutionOverride|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|) + public final val hideBySeverityDerived: R|kotlin/collections/MutableSet|by this@R|/Some|.R|/BaseState.propertyDerived||>(R|kotlin/collections/mutableSetOf|()).R|SubstitutionOverride|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|) public get(): R|kotlin/collections/MutableSet| { - ^ this@R|/Some|.D|/Some.hideBySeverityDerived|.R|SubstitutionOverride|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|) + ^ this@R|/Some|.D|/Some.hideBySeverityDerived|.R|SubstitutionOverride|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|) } public final val hideBySeverityBase: R|kotlin/collections/MutableSet|by this@R|/Some|.R|/BaseState.propertyBase||>(R|kotlin/collections/mutableSetOf|()) public get(): R|kotlin/collections/MutableSet| { - ^ this@R|/Some|.D|/Some.hideBySeverityBase|.R|SubstitutionOverride|(this@R|/Some|, ::R|/Some.hideBySeverityBase|) + ^ this@R|/Some|.D|/Some.hideBySeverityBase|.R|SubstitutionOverride|(this@R|/Some|, ::R|/Some.hideBySeverityBase|) } } diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeTypes.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeTypes.kt index 94139a782ed..dd91b0e97c3 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeTypes.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeTypes.kt @@ -357,7 +357,7 @@ sealed class ConeStubType(val constructor: ConeStubTypeConstructor, override val } } -open class ConeStubTypeForBuilderInference(constructor: ConeStubTypeConstructor, nullability: ConeNullability) : +open class ConeStubTypeForChainInference(constructor: ConeStubTypeConstructor, nullability: ConeNullability) : ConeStubType(constructor, nullability) { constructor(variable: ConeTypeVariable, nullability: ConeNullability) : this( ConeStubTypeConstructor( @@ -367,8 +367,8 @@ open class ConeStubTypeForBuilderInference(constructor: ConeStubTypeConstructor, ) } -class ConeStubTypeForFixation(constructor: ConeStubTypeConstructor, nullability: ConeNullability) : - ConeStubTypeForBuilderInference(constructor, nullability) +class ConeStubTypeForSyntheticFixation(constructor: ConeStubTypeConstructor, nullability: ConeNullability) : + ConeStubTypeForChainInference(constructor, nullability) class ConeStubTypeForTypeVariableInSubtyping(constructor: ConeStubTypeConstructor, nullability: ConeNullability) : ConeStubType(constructor, nullability) { diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/TypeRenderer.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/TypeRenderer.kt index 911f1ac69da..06d1c7a8d57 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/TypeRenderer.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/TypeRenderer.kt @@ -46,7 +46,8 @@ fun ConeKotlinType.render(): String { postfix = ")" ) } - is ConeStubTypeForBuilderInference -> "${renderAttributes()}Stub (builder inference): ${constructor.variable}" + is ConeStubTypeForChainInference -> "${renderAttributes()}Stub (chain inference): ${constructor.variable}" + is ConeStubTypeForSyntheticFixation -> "${renderAttributes()}Stub (fixation): ${constructor.variable}" is ConeStubType -> "${renderAttributes()}Stub (subtyping): ${constructor.variable}" is ConeIntegerLiteralType -> "${renderAttributes()}ILT: $value" } + nullabilitySuffix diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt index 4429782623f..314671589d2 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt @@ -264,7 +264,7 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext, ConeTypeCo override fun createStubTypeForBuilderInference(typeVariable: TypeVariableMarker): StubTypeMarker { require(typeVariable is ConeTypeVariable) { "$typeVariable should subtype of ${ConeTypeVariable::class.qualifiedName}" } - return ConeStubTypeForBuilderInference(typeVariable, ConeNullability.create(typeVariable.defaultType().isMarkedNullable())) + return ConeStubTypeForChainInference(typeVariable, ConeNullability.create(typeVariable.defaultType().isMarkedNullable())) } override fun createStubTypeForTypeVariablesInSubtyping(typeVariable: TypeVariableMarker): StubTypeMarker { diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt index 4fbbd85f769..9479632ebae 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt @@ -429,7 +429,7 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty } override fun SimpleTypeMarker.isStubTypeForBuilderInference(): Boolean { - return this is ConeStubTypeForBuilderInference + return this is ConeStubTypeForChainInference } override fun TypeConstructorMarker.unwrapStubTypeVariableConstructor(): TypeConstructorMarker { diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt index db7d0bf334a..0f70318429d 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt @@ -165,7 +165,7 @@ fun T.withNullability( ConeNullability.UNKNOWN -> this // TODO: is that correct? ConeNullability.NOT_NULL -> this } - is ConeStubTypeForBuilderInference -> ConeStubTypeForBuilderInference(constructor, nullability) + is ConeStubTypeForChainInference -> ConeStubTypeForChainInference(constructor, nullability) is ConeStubTypeForTypeVariableInSubtyping -> ConeStubTypeForTypeVariableInSubtyping(constructor, nullability) is ConeDefinitelyNotNullType -> when (nullability) { ConeNullability.NOT_NULL -> this diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirBuilderInferenceSession.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirBuilderInferenceSession.kt index 5a0ca801efc..83430bb7faa 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirBuilderInferenceSession.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirBuilderInferenceSession.kt @@ -76,7 +76,7 @@ class FirBuilderInferenceSession( private fun ConeKotlinType.containsStubType(): Boolean { return this.contains { - it is ConeStubTypeForBuilderInference + it is ConeStubTypeForChainInference } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirDelegatedPropertyInferenceSession.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirDelegatedPropertyInferenceSession.kt index 74dff3ae62b..b4b85e8bb1d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirDelegatedPropertyInferenceSession.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirDelegatedPropertyInferenceSession.kt @@ -35,7 +35,7 @@ class FirDelegatedPropertyInferenceSession( private fun ConeKotlinType.containsStubType(): Boolean { return this.contains { - it is ConeStubTypeForBuilderInference + it is ConeStubTypeForChainInference } } @@ -155,7 +155,7 @@ class FirDelegatedPropertyInferenceSession( typeVariable as ConeTypeVariable completionContext.fixVariable( typeVariable, - ConeStubTypeForFixation( + ConeStubTypeForSyntheticFixation( ConeStubTypeConstructor(typeVariable, isTypeVariableInSubtyping = false, isForFixation = true), ConeNullability.create(typeVariable.defaultType.isMarkedNullable) ), @@ -248,7 +248,7 @@ class FirDelegatedPropertyInferenceSession( } stubTypesByTypeVariable.getOrPut(variable) { - ConeStubTypeForBuilderInference( + ConeStubTypeForChainInference( syntheticVariable, ConeNullability.create(syntheticVariable.defaultType.isMarkedNullable) ).also {