diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot index f207bd82c6a..fef3d1dba69 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot @@ -190,9 +190,9 @@ digraph delegateWithAnonymousObject_kt { 71 [label="Enter property" style="filled" fillcolor=red]; 72 [label="Postponed enter to lambda"]; 73 [label="Postponed exit from lambda"]; - 74 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)"]; + 74 [label="Function call: R?C|/delegate|(...)"]; 75 [label="Access variable this@R|/IssuesListUserProfile|"]; - 76 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...).#(...)"]; + 76 [label="Function call: R?C|/delegate|(...).R?C|special/error|(...)"]; 77 [label="Postponed enter to lambda"]; subgraph cluster_19 { color=blue @@ -216,6 +216,8 @@ digraph delegateWithAnonymousObject_kt { 79 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)"]; 80 [label="Exit property" style="filled" fillcolor=red]; } + 70 -> {71}; + 71 -> {72} [color=red]; 71 -> {72}; 72 -> {73}; 72 -> {} [style=dashed]; 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 7cbe5144e51..604cf0dfc7f 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.fir.txt @@ -30,9 +30,9 @@ FILE: hideBySeverity.kt super() } - public final val hideBySeverityDerived: R|kotlin/collections/MutableSet|by this@R|/Some|.#(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|()) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.kt index 42ab8da35f5..2b66a7b3255 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/hideBySeverity.kt @@ -18,7 +18,7 @@ abstract class BaseState { } abstract class Some : BaseState() { - val hideBySeverityDerived: MutableSet by propertyDerived(mutableSetOf()) + val hideBySeverityDerived: MutableSet by propertyDerived(mutableSetOf()) val hideBySeverityBase: MutableSet by propertyBase(mutableSetOf()) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt index 7b7c8b936ed..c5ffe08f141 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt @@ -231,6 +231,15 @@ private fun mapInapplicableCandidateError( rootCause.isCastToNotNull ) is DslScopeViolation -> FirErrors.DSL_SCOPE_VIOLATION.createOn(source, rootCause.calleeSymbol) + is InferenceError -> { + rootCause.constraintError.toDiagnostic( + source, + qualifiedAccessSource, + session.typeContext, + mutableSetOf(), + diagnostic.candidate + ) + } else -> genericDiagnostic } }.distinct() diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/AbstractManyCandidatesInferenceSession.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/AbstractManyCandidatesInferenceSession.kt index b41f62a0249..974c5c064b4 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/AbstractManyCandidatesInferenceSession.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/AbstractManyCandidatesInferenceSession.kt @@ -27,7 +27,7 @@ abstract class AbstractManyCandidatesInferenceSession( get() = partiallyResolvedCalls.lastOrNull() ?.second ?.system - ?.currentStorage() + ?.asReadOnlyStorage() ?: ConstraintStorage.Empty override fun addCompletedCall(call: T, candidate: Candidate) where T : FirResolvable, T : FirStatement { @@ -48,4 +48,10 @@ abstract class AbstractManyCandidatesInferenceSession( protected val FirResolvable.candidate: Candidate get() = candidate()!! + + override fun clear() { + errorCalls.clear() + partiallyResolvedCalls.clear() + completedCalls.clear() + } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/ConstraintSystemCompleter.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/ConstraintSystemCompleter.kt index 3d054338a56..94be84cc421 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/ConstraintSystemCompleter.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/ConstraintSystemCompleter.kt @@ -421,6 +421,7 @@ class ConstraintSystemCompleter(private val components: BodyResolveComponents) { fun FirStatement.processAllContainingCallCandidates(processBlocks: Boolean, processor: (Candidate) -> Unit) { when (this) { is FirFunctionCall -> { + explicitReceiver?.processAllContainingCallCandidates(processBlocks, processor) processCandidateIfApplicable(processor, processBlocks) this.arguments.forEach { it.processAllContainingCallCandidates(processBlocks, processor) } } @@ -446,10 +447,12 @@ fun FirStatement.processAllContainingCallCandidates(processBlocks: Boolean, proc } is FirQualifiedAccessExpression -> { + explicitReceiver?.processAllContainingCallCandidates(processBlocks, processor) processCandidateIfApplicable(processor, processBlocks) } is FirVariableAssignment -> { + explicitReceiver?.processAllContainingCallCandidates(processBlocks, processor) processCandidateIfApplicable(processor, processBlocks) rValue.processAllContainingCallCandidates(processBlocks, processor) } 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 2955dc7af40..8b68c7117ae 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 @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.fir.expressions.FirStatement import org.jetbrains.kotlin.fir.references.FirNamedReference import org.jetbrains.kotlin.fir.resolve.calls.Candidate import org.jetbrains.kotlin.fir.resolve.calls.FirNamedReferenceWithCandidate +import org.jetbrains.kotlin.fir.resolve.calls.InferenceError import org.jetbrains.kotlin.fir.resolve.calls.ResolutionContext import org.jetbrains.kotlin.fir.resolve.defaultType import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor @@ -82,7 +83,7 @@ class FirDelegatedPropertyInferenceSession( for ((_, candidate) in partiallyResolvedCalls) { for (error in commonSystem.errors) { - candidate.system.addError(error) + candidate.addDiagnostic(InferenceError(error)) } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirInferenceSession.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirInferenceSession.kt index ce74f7871b5..da9d03db93f 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirInferenceSession.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirInferenceSession.kt @@ -35,6 +35,8 @@ abstract class FirInferenceSession { abstract fun writeOnlyStubs(call: T): Boolean where T : FirResolvable, T : FirStatement abstract fun callCompleted(call: T): Boolean where T : FirResolvable, T : FirStatement abstract fun shouldCompleteResolvedSubAtomsOf(call: T): Boolean where T : FirResolvable, T : FirStatement + + abstract fun clear() } abstract class FirStubInferenceSession : FirInferenceSession() { @@ -56,4 +58,7 @@ abstract class FirStubInferenceSession : FirInferenceSession() { override fun writeOnlyStubs(call: T): Boolean where T : FirResolvable, T : FirStatement = false override fun callCompleted(call: T): Boolean where T : FirResolvable, T : FirStatement = false override fun shouldCompleteResolvedSubAtomsOf(call: T): Boolean where T : FirResolvable, T : FirStatement = true + + override fun clear() { + } } 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 6ba45eabd0f..8d1e866a371 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 @@ -25,6 +25,7 @@ import org.jetbrains.kotlin.fir.expressions.builder.buildUnitExpression import org.jetbrains.kotlin.fir.expressions.impl.FirLazyBlock import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference import org.jetbrains.kotlin.fir.resolve.ResolutionMode +import org.jetbrains.kotlin.fir.resolve.calls.FirErrorReferenceWithCandidate import org.jetbrains.kotlin.fir.resolve.calls.FirNamedReferenceWithCandidate import org.jetbrains.kotlin.fir.resolve.constructFunctionalTypeRef import org.jetbrains.kotlin.fir.resolve.dfa.FirControlFlowGraphReferenceImpl @@ -140,7 +141,6 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor var backingFieldIsAlreadyResolved = false context.withProperty(property) { context.forPropertyInitializer { - property.transformDelegate(transformer, ResolutionMode.ContextDependentDelegate) if (!initializerIsAlreadyResolved) { property.transformChildrenWithoutComponents(returnTypeRef) property.replaceBodyResolveState(FirPropertyBodyResolveState.INITIALIZER_RESOLVED) @@ -265,6 +265,13 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor private fun transformPropertyAccessorsWithDelegate(property: FirProperty, delegateExpression: FirExpression) { context.forPropertyDelegateAccessors(property, delegateExpression, resolutionContext, callCompleter) { + if (property.isLocal) { + property.transformDelegate(transformer, ResolutionMode.ContextDependentDelegate) + } else { + context.forPropertyInitializer { + property.transformDelegate(transformer, ResolutionMode.ContextDependentDelegate) + } + } property.transformAccessors() val completedCalls = completeCandidates() val finalSubstitutor = createFinalSubstitutor() @@ -290,6 +297,8 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor val delegateProvider = wrappedDelegateExpression.delegateProvider.transformSingle(transformer, data) when (val calleeReference = (delegateProvider as FirResolvable).calleeReference) { is FirResolvedNamedReference -> return delegateProvider + is FirErrorReferenceWithCandidate -> { + } is FirNamedReferenceWithCandidate -> { val candidate = calleeReference.candidate if (!candidate.system.hasContradiction) { @@ -298,7 +307,9 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor } } + context.inferenceSession.clear() (delegateProvider as? FirFunctionCall)?.let { dataFlowAnalyzer.dropSubgraphFromCall(it) } + return wrappedDelegateExpression.expression .transformSingle(transformer, data) .approximateIfIsIntegerConst() @@ -309,7 +320,6 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor private fun transformLocalVariable(variable: FirProperty): FirProperty { assert(variable.isLocal) - variable.transformDelegate(transformer, ResolutionMode.ContextDependentDelegate) val delegate = variable.delegate val hadExplicitType = variable.returnTypeRef !is FirImplicitTypeRef @@ -341,7 +351,6 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor val data = withExpectedType(returnTypeRef) return transformReturnTypeRef(transformer, data) .transformInitializer(transformer, data) - .transformDelegate(transformer, data) .transformTypeParameters(transformer, data) .transformOtherChildren(transformer, data) } diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionDiagnostic.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionDiagnostic.kt index 3716d0aa3e5..f017438b939 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionDiagnostic.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionDiagnostic.kt @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.resolve.ForbiddenNamedArgumentsTarget +import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintSystemError import org.jetbrains.kotlin.resolve.calls.tower.CandidateApplicability import org.jetbrains.kotlin.resolve.calls.tower.CandidateApplicability.* @@ -101,6 +102,7 @@ class ManyLambdaExpressionArguments( class InfixCallOfNonInfixFunction(val function: FirNamedFunctionSymbol) : ResolutionDiagnostic(INAPPLICABLE_MODIFIER) class OperatorCallOfNonOperatorFunction(val function: FirNamedFunctionSymbol) : ResolutionDiagnostic(INAPPLICABLE_MODIFIER) +class InferenceError(val constraintError: ConstraintSystemError) : ResolutionDiagnostic(constraintError.applicability) class Unsupported(val message: String, val source: KtSourceElement? = null) : ResolutionDiagnostic(UNSUPPORTED) object PropertyAsOperator : ResolutionDiagnostic(PROPERTY_AS_OPERATOR) diff --git a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt index 0c5f2270f56..4faadf2095e 100644 --- a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt +++ b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt @@ -33,8 +33,8 @@ operator fun CustomDelegate3.setValue(thisRef: Any?, prop: KProperty<*>, value: class Example { - var a by CustomDelegate() - val aval by CustomDelegate() + var a by CustomDelegate() + val aval by CustomDelegate() var b by OkDelegate() var c by CustomDelegate2() var d by CustomDelegate3() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt index 5cc2ad92818..987cca15202 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt @@ -9,10 +9,10 @@ class A(outer: Outer) { var g: String by outer.getContainer().getMyProperty() - var b: String by foo(getMyProperty()) - var r: String by foo(outer.getContainer().getMyProperty()) - var e: String by + foo(getMyProperty()) - var f: String by foo(getMyProperty()) - 1 + var b: String by foo(getMyProperty()) + var r: String by foo(outer.getContainer().getMyProperty()) + var e: String by + foo(getMyProperty()) + var f: String by foo(getMyProperty()) - 1 } fun foo(a: Any?) = MyProperty() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt index 660122e8850..3bba6c5ac33 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt @@ -24,4 +24,4 @@ class C() { } var c1: Int by C() -var c2: Int by C() +var c2: Int by C() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.fir.kt index 803c472b82a..26d22b8721e 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.fir.kt @@ -3,7 +3,7 @@ import kotlin.reflect.KProperty var a: Int by A() -var a1 by A() +var a1 by A() var b: Int by B() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.fir.kt index b822b045f4f..3be15842339 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.fir.kt @@ -8,6 +8,6 @@ object CommonCase { operator fun Fas.provideDelegate(host: D, p: Any?): Fas = TODO() operator fun Fas.getValue(receiver: E, p: Any?): R = TODO() - val Long.test1: String by delegate() // common test, not working because of Inference1 + val Long.test1: String by delegate() // common test, not working because of Inference1 val Long.test2: String by delegate() // should work } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.fir.kt deleted file mode 100644 index fdff4a9af41..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -object T2 { - interface Foo - - fun delegate(): Foo = TODO() - - operator fun Foo.provideDelegate(host: T2, p: Any?): Foo = TODO() - operator fun Foo.getValue(receiver: String, p: Any?): T = TODO() - - val String.test1: String by delegate() - val test2: String by delegate() -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt index 88fd51b3f3b..72808b722b1 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER object T2 { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.fir.kt deleted file mode 100644 index 8675a610495..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -object T3 { - interface Foo - - fun delegate(): Foo = TODO() - - operator fun Foo.provideDelegate(host: T3, p: Any?): Foo = TODO() - operator fun Foo.getValue(receiver: T3, p: Any?): T = TODO() - - val test1: String by delegate() -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt index 724f8ffddad..b3672a1d18d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER object T3 { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.fir.kt index 59f2a8d6124..2dc1c992fea 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.fir.kt @@ -8,6 +8,6 @@ object Inference2 { operator fun Foo.provideDelegate(host: T, p: Any?): Foo = TODO() operator fun Foo.getValue(receiver: Inference2, p: Any?): String = TODO() - val test1: String by delegate() // same story like in Inference1 + val test1: String by delegate() // same story like in Inference1 val test2: String by delegate() } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/kt38714.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/kt38714.fir.kt index f904bcb18c2..0725609927f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/kt38714.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/kt38714.fir.kt @@ -4,7 +4,7 @@ import kotlin.reflect.KProperty abstract class MainActivity : DIAware1() { - val bar: Bar by instance1() + val bar: Bar by instance1() } class Bar diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt index 7557e21812e..093eca752ea 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt @@ -9,6 +9,6 @@ operator fun String.provideDelegate(thisRef: Any?, prop: Any) = WrongDelegate(th operator fun String.getValue(thisRef: Any?, prop: Any) = this -val test1: String by "OK" +val test1: String by "OK" val test2: Int by "OK" val test3 by "OK" diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt index 5f3e9b7a50d..0bc66c979b6 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty -val c: Int by Delegate() +val c: Int by Delegate() class Delegate { operator fun getValue(t: Any?, p: KProperty<*>): String {