diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index f10f7fc9d85..f7b87a9ad3a 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -55,6 +55,7 @@ public interface Errors { DiagnosticFactory1 NEW_INFERENCE_ERROR = DiagnosticFactory1.create(ERROR); DiagnosticFactory1 NEW_INFERENCE_DIAGNOSTIC = DiagnosticFactory1.create(WARNING); + DiagnosticFactory0 NON_APPLICABLE_CALL_FOR_BUILDER_INFERENCE = DiagnosticFactory0.create(WARNING); DiagnosticFactory1> UNSUPPORTED_FEATURE = DiagnosticFactory1.create(ERROR); DiagnosticFactory1 EXCEPTION_FROM_ANALYZER = DiagnosticFactory1.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 275edc32390..7521ca5de6c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -633,6 +633,7 @@ public class DefaultErrorMessages { MAP.put(UNSUPPORTED, "Unsupported [{0}]", STRING); MAP.put(NEW_INFERENCE_ERROR, "New inference error [{0}]", STRING); MAP.put(NEW_INFERENCE_DIAGNOSTIC, "New inference [{0}]", STRING); + MAP.put(NON_APPLICABLE_CALL_FOR_BUILDER_INFERENCE, "Non-applicable call for builder inference"); MAP.put(UNSUPPORTED_FEATURE, "{0}", new LanguageFeatureMessageRenderer(LanguageFeatureMessageRenderer.Type.UNSUPPORTED)); MAP.put(EXPERIMENTAL_FEATURE_WARNING, "{0}", new LanguageFeatureMessageRenderer(LanguageFeatureMessageRenderer.Type.WARNING)); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt index 5561999c986..50c91b3778e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.diagnostics.Errors import org.jetbrains.kotlin.diagnostics.Errors.* import org.jetbrains.kotlin.diagnostics.Errors.BadNamedArgumentsTarget.INVOKE_ON_FUNCTION_TYPE import org.jetbrains.kotlin.diagnostics.Errors.BadNamedArgumentsTarget.NON_KOTLIN_FUNCTION +import org.jetbrains.kotlin.diagnostics.reportDiagnosticOnce import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall @@ -49,6 +50,10 @@ class DiagnosticReporterByTrackingStrategy( ) InstantiationOfAbstractClass::class.java -> tracingStrategy.instantiationOfAbstractClass(trace) AbstractSuperCall::class.java -> tracingStrategy.abstractSuperCall(trace) + NonApplicableCallForBuilderInferenceDiagnostic::class.java -> { + val reportOn = (diagnostic as NonApplicableCallForBuilderInferenceDiagnostic).kotlinCall + trace.reportDiagnosticOnce(Errors.NON_APPLICABLE_CALL_FOR_BUILDER_INFERENCE.on(reportOn.psiKotlinCall.psiCall.callElement)) + } } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt index 7734b3cbbf5..20cc56de330 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.resolve.calls.inference import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.descriptors.CallableDescriptor -import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.ModuleDescriptor import org.jetbrains.kotlin.resolve.BindingTrace import org.jetbrains.kotlin.resolve.TemporaryBindingTrace @@ -22,9 +21,7 @@ import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintKind import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage import org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl import org.jetbrains.kotlin.resolve.calls.inference.model.NewTypeVariable -import org.jetbrains.kotlin.resolve.calls.model.KotlinCallComponents -import org.jetbrains.kotlin.resolve.calls.model.KotlinResolutionCandidate -import org.jetbrains.kotlin.resolve.calls.model.ResolvedLambdaAtom +import org.jetbrains.kotlin.resolve.calls.model.* import org.jetbrains.kotlin.resolve.calls.tower.* import org.jetbrains.kotlin.resolve.deprecation.DeprecationResolver import org.jetbrains.kotlin.types.StubType @@ -51,19 +48,25 @@ class CoroutineInferenceSession( ) : ManyCandidatesResolver( psiCallResolver, postponedArgumentsAnalyzer, kotlinConstraintSystemCompleter, callComponents, builtIns ) { - private val suspendCompletedCalls = arrayListOf() - private val normalCompletedCalls = arrayListOf() + private val commonCalls = arrayListOf() + private val diagnostics = arrayListOf() override fun shouldRunCompletion(candidate: KotlinResolutionCandidate): Boolean = true override fun addCompletedCallInfo(callInfo: CompletedCallInfo) { require(callInfo is PSICompletedCallInfo) { "Wrong instance of callInfo: $callInfo" } - val candidateDescriptor = callInfo.callResolutionResult.resultCallAtom.candidateDescriptor - if (candidateDescriptor is FunctionDescriptor && candidateDescriptor.isSuspend) - suspendCompletedCalls.add(callInfo) - else - normalCompletedCalls.add(callInfo) + commonCalls.add(callInfo) + + val isApplicableCall = + callComponents.statelessCallbacks.isApplicableCallForBuilderInference( + callInfo.resolvedCall.resultingDescriptor, + callComponents.languageVersionSettings + ) + + if (!isApplicableCall) { + diagnostics.add(NonApplicableCallForBuilderInferenceDiagnostic(callInfo.callResolutionResult.resultCallAtom.atom)) + } } override fun writeOnlyStubs(): Boolean { @@ -140,8 +143,11 @@ class CoroutineInferenceSession( integrateConstraints(commonSystem, initialStorage, nonFixedToVariablesSubstitutor) - for (suspendCall in suspendCompletedCalls) { - integrateConstraints(commonSystem, suspendCall.callResolutionResult.constraintSystem, nonFixedToVariablesSubstitutor) + for (call in commonCalls) { + integrateConstraints(commonSystem, call.callResolutionResult.constraintSystem, nonFixedToVariablesSubstitutor) + } + for (diagnostic in diagnostics) { + commonSystem.addError(diagnostic) } return commonSystem @@ -155,7 +161,7 @@ class CoroutineInferenceSession( val nonFixedTypesToResultSubstitutor = ComposedSubstitutor(commonSystemSubstitutor, nonFixedToVariablesSubstitutor) - for (completedCall in suspendCompletedCalls + normalCompletedCalls) { + for (completedCall in commonCalls) { val resultCallAtom = completedCall.callResolutionResult.resultCallAtom val call = resultCallAtom.atom.getResolvedPsiKotlinCall(trace) ?: continue diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceUtil.kt index abe1c9437ea..fbd86e46391 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceUtil.kt @@ -221,7 +221,7 @@ class CoroutineInferenceSupport( if (!resultingCall.isReallySuccess()) return val resultingDescriptor = resultingCall.resultingDescriptor - if (!isGoodCall(resultingDescriptor)) { + if (!isApplicableCallForBuilderInference(resultingDescriptor, languageVersionSettings)) { inferenceData.badCallHappened() } @@ -250,32 +250,6 @@ class CoroutineInferenceSupport( } } - private fun KotlinType.containsTypeTemplate() = contains { it is TypeTemplate } - - private fun isGoodCall(resultingDescriptor: CallableDescriptor): Boolean { - if (!languageVersionSettings.supportsFeature(LanguageFeature.ExperimentalBuilderInference)) { - return isGoodCallForOldCoroutines(resultingDescriptor) - } - - if (resultingDescriptor.isExtension && !resultingDescriptor.hasBuilderInferenceAnnotation()) { - return resultingDescriptor.extensionReceiverParameter?.type?.containsTypeTemplate() == false - } - - val returnType = resultingDescriptor.returnType ?: return false - return !returnType.containsTypeTemplate() - } - - private fun isGoodCallForOldCoroutines(resultingDescriptor: CallableDescriptor): Boolean { - val returnType = resultingDescriptor.returnType ?: return false - if (returnType.containsTypeTemplate()) return false - - if (resultingDescriptor !is FunctionDescriptor || resultingDescriptor.isSuspend) return true - - if (resultingDescriptor.valueParameters.any { it.type.containsTypeTemplate() }) return false - - return true - } - private class CoroutineTypeCheckerContext( private val allowOnlyTrivialConstraints: Boolean ) : ClassicTypeCheckerContext(errorTypeEqualsToAnything = true) { @@ -320,6 +294,32 @@ class CoroutineInferenceSupport( } } +private fun KotlinType.containsTypeTemplate() = contains { it is TypeTemplate || it is StubType } + +fun isApplicableCallForBuilderInference(descriptor: CallableDescriptor, languageVersionSettings: LanguageVersionSettings): Boolean { + if (!languageVersionSettings.supportsFeature(LanguageFeature.ExperimentalBuilderInference)) { + return isGoodCallForOldCoroutines(descriptor) + } + + if (descriptor.isExtension && !descriptor.hasBuilderInferenceAnnotation()) { + return descriptor.extensionReceiverParameter?.type?.containsTypeTemplate() == false + } + + val returnType = descriptor.returnType ?: return false + return !returnType.containsTypeTemplate() +} + +private fun isGoodCallForOldCoroutines(resultingDescriptor: CallableDescriptor): Boolean { + val returnType = resultingDescriptor.returnType ?: return false + if (returnType.containsTypeTemplate()) return false + + if (resultingDescriptor !is FunctionDescriptor || resultingDescriptor.isSuspend) return true + + if (resultingDescriptor.valueParameters.any { it.type.containsTypeTemplate() }) return false + + return true +} + fun isCoroutineCallWithAdditionalInference( parameterDescriptor: ValueParameterDescriptor, argument: ValueArgument, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt index b769fb45cdd..a644f0ac398 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt @@ -205,7 +205,7 @@ class KotlinResolutionCallbacksImpl( } override fun bindStubResolvedCallForCandidate(candidate: ResolvedCallAtom) { - kotlinToResolvedCallTransformer.createStubResolvedCallAndWriteItToTrace(candidate, trace, emptyList()) + kotlinToResolvedCallTransformer.createStubResolvedCallAndWriteItToTrace(candidate, trace, emptyList(), substitutor = null) } override fun createReceiverWithSmartCastInfo(resolvedAtom: ResolvedCallAtom): ReceiverValueWithSmartCastInfo? { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionStatelessCallbacksImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionStatelessCallbacksImpl.kt index 22a5fe1aea7..53f8eb3ef66 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionStatelessCallbacksImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionStatelessCallbacksImpl.kt @@ -73,4 +73,11 @@ class KotlinResolutionStatelessCallbacksImpl( override fun isCoroutineCall(argument: KotlinCallArgument, parameter: ValueParameterDescriptor): Boolean = isCoroutineCallWithAdditionalInference(parameter, argument.psiCallArgument.valueArgument, languageVersionSettings) + + override fun isApplicableCallForBuilderInference( + descriptor: CallableDescriptor, + languageVersionSettings: LanguageVersionSettings + ): Boolean { + return org.jetbrains.kotlin.resolve.calls.inference.isApplicableCallForBuilderInference(descriptor, languageVersionSettings) + } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinToResolvedCallTransformer.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinToResolvedCallTransformer.kt index cf8fa43cf2b..66f381623b8 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinToResolvedCallTransformer.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinToResolvedCallTransformer.kt @@ -100,26 +100,26 @@ class KotlinToResolvedCallTransformer( PSIPartialCallInfo(baseResolvedCall, context, tracingStrategy) ) - createStubResolvedCallAndWriteItToTrace(candidate, context.trace, baseResolvedCall.diagnostics) + createStubResolvedCallAndWriteItToTrace(candidate, context.trace, baseResolvedCall.diagnostics, substitutor = null) } is CompletedCallResolutionResult, is ErrorCallResolutionResult -> { val candidate = (baseResolvedCall as SingleCallResolutionResult).resultCallAtom - if (baseResolvedCall is CompletedCallResolutionResult) { - context.inferenceSession.addCompletedCallInfo(PSICompletedCallInfo(baseResolvedCall, context, tracingStrategy)) - } - + val resultSubstitutor = baseResolvedCall.constraintSystem.buildResultingSubstitutor() if (context.inferenceSession.writeOnlyStubs()) { - return createStubResolvedCallAndWriteItToTrace( + val stub = createStubResolvedCallAndWriteItToTrace( candidate, context.trace, baseResolvedCall.diagnostics, - completedCall = true + substitutor = resultSubstitutor ) + + forwardCallToInferenceSession(baseResolvedCall, context, stub, tracingStrategy) + + return stub as ResolvedCall } - val resultSubstitutor = baseResolvedCall.constraintSystem.buildResultingSubstitutor() val ktPrimitiveCompleter = ResolvedAtomCompleter( resultSubstitutor, context, this, expressionTypingServices, argumentTypeResolver, doubleColonExpressionResolver, builtIns, deprecationResolver, moduleDescriptor, dataFlowValueFactory @@ -129,7 +129,10 @@ class KotlinToResolvedCallTransformer( ktPrimitiveCompleter.completeAll(subKtPrimitive) } - ktPrimitiveCompleter.completeResolvedCall(candidate, baseResolvedCall.diagnostics) as ResolvedCall + val resolvedCall = ktPrimitiveCompleter.completeResolvedCall(candidate, baseResolvedCall.diagnostics) as ResolvedCall + forwardCallToInferenceSession(baseResolvedCall, context, resolvedCall, tracingStrategy) + + resolvedCall } is SingleCallResolutionResult -> error("Call resolution result for one candidate didn't transformed: $baseResolvedCall") @@ -137,13 +140,23 @@ class KotlinToResolvedCallTransformer( } } + private fun forwardCallToInferenceSession( + baseResolvedCall: CallResolutionResult, + context: BasicCallResolutionContext, + resolvedCall: ResolvedCall<*>, + tracingStrategy: TracingStrategy + ) { + if (baseResolvedCall is CompletedCallResolutionResult) { + context.inferenceSession.addCompletedCallInfo(PSICompletedCallInfo(baseResolvedCall, context, resolvedCall, tracingStrategy)) + } + } + fun createStubResolvedCallAndWriteItToTrace( candidate: ResolvedCallAtom, trace: BindingTrace, diagnostics: Collection, - completedCall: Boolean = false + substitutor: NewTypeSubstitutor? ): ResolvedCall { - val substitutor = if (completedCall) NewTypeSubstitutorByConstructorMap(emptyMap()) else null val result = transformToResolvedCall(candidate, trace, substitutor, diagnostics) val psiKotlinCall = candidate.atom.psiKotlinCall val tracing = psiKotlinCall.safeAs()?.baseCall?.tracingStrategy ?: psiKotlinCall.tracingStrategy diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt index e3ef448a063..244aef4342d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt @@ -122,6 +122,7 @@ class PSIPartialCallInfo( class PSICompletedCallInfo( override val callResolutionResult: CompletedCallResolutionResult, val context: BasicCallResolutionContext, + val resolvedCall: ResolvedCall<*>, val tracingStrategy: TracingStrategy ) : CompletedCallInfo diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ExternalComponents.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ExternalComponents.kt index 90938eea09e..7feb5cd22bd 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ExternalComponents.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ExternalComponents.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.resolve.calls.components +import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor @@ -29,6 +30,7 @@ interface KotlinResolutionStatelessCallbacks { fun getScopeTowerForCallableReferenceArgument(argument: CallableReferenceKotlinCallArgument): ImplicitScopeTower fun getVariableCandidateIfInvoke(functionCall: KotlinCall): KotlinResolutionCandidate? fun isCoroutineCall(argument: KotlinCallArgument, parameter: ValueParameterDescriptor): Boolean + fun isApplicableCallForBuilderInference(descriptor: CallableDescriptor, languageVersionSettings: LanguageVersionSettings): Boolean } // This components hold state (trace). Work with this carefully. diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallDiagnostics.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallDiagnostics.kt index 933fa0386f1..447cc24ed56 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallDiagnostics.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallDiagnostics.kt @@ -179,4 +179,10 @@ class ManyCandidatesCallDiagnostic( override fun report(reporter: DiagnosticReporter) { reporter.onCall(this) } +} + +class NonApplicableCallForBuilderInferenceDiagnostic(val kotlinCall: KotlinCall) : KotlinCallDiagnostic(CONVENTION_ERROR) { + override fun report(reporter: DiagnosticReporter) { + reporter.onCall(this) + } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt index e47071c2558..1f7cb3dc018 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt @@ -53,7 +53,7 @@ val test6 = generate { } val test7 = generate { - yield("baz") + yield("baz") genericExtension() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt index fa5753107dd..4b2dfcbb0cd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt @@ -5,9 +5,9 @@ public val test2: kotlin.Any? public val test3: kotlin.Int public val test4: kotlin.Any? public val test5: kotlin.Int -public val test6: kotlin.String -public val test7: kotlin.String -public val test8: kotlin.Any? +public val test6: kotlin.Any? +public val test7: kotlin.Int +public val test8: kotlin.String public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S public fun Base.baseExtension(): kotlin.Unit public fun Controller.genericExtension(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.kt index 3379b5ec4bb..2a1ad52c01d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.kt @@ -23,7 +23,7 @@ val memberWithoutAnn = build { - extensionAdd("foo") + extensionAdd("foo") } val safeExtension = build { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.ni.txt index aeffde73da1..97b528581b6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.ni.txt @@ -1,6 +1,6 @@ package -public val extension: kotlin.collections.List +public val extension: kotlin.collections.List public val member: kotlin.collections.List public val memberWithoutAnn: kotlin.collections.List public val safeExtension: kotlin.collections.List diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.kt index 4404175b6e1..c14299a97ad 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.kt @@ -30,7 +30,7 @@ val memberWithoutAnn = build { - extensionAdd("foo") + extensionAdd("foo") } val safeExtension = build { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.ni.txt index aefcbf7128c..25ef4449a8d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.ni.txt @@ -1,9 +1,9 @@ package -public val extension: kotlin.collections.List -public val member: kotlin.collections.List +public val extension: kotlin.collections.List +public val member: kotlin.collections.List public val memberWithoutAnn: kotlin.collections.List -public val safeExtension: kotlin.collections.List +public val safeExtension: kotlin.collections.List public fun build(/*0*/ @kotlin.BuilderInference g: Builder.() -> kotlin.Unit): kotlin.collections.List public fun wrongBuild(/*0*/ g: Builder.() -> kotlin.Unit): kotlin.collections.List public fun Builder.extensionAdd(/*0*/ s: S): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/useInferenceInformationFromExtension.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/useInferenceInformationFromExtension.kt index 8a28614e29a..a98f2287976 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/useInferenceInformationFromExtension.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/useInferenceInformationFromExtension.kt @@ -26,7 +26,7 @@ val normal = generate { } val extension = generate { - extensionYield("foo") + extensionYield("foo") } val safeExtension = generate { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt index eef21a34488..c59c484cd25 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt @@ -1,6 +1,8 @@ // !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference // !DIAGNOSTICS: -EXPERIMENTAL_FEATURE_WARNING +// !WITH_NEW_INFERENCE // SKIP_TXT + @kotlin.coroutines.experimental.RestrictsSuspension class RestrictedController { suspend fun yield(x: T) {} @@ -75,13 +77,13 @@ fun test() { this@a.yield(1) this@a.yield2(1) - with(this) { + with(this) { yield("") this@with.yield("") yield2("") this@with.yield2("") - } + } } }