[NI] Align builder inference with the old inference

#KT-29184 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-03-26 15:32:39 +03:00
parent 1eb70ea19e
commit b10d19dc78
19 changed files with 110 additions and 66 deletions
@@ -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.
@@ -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)
}
}