[NI] Introduce method to add extra constraints before completion

This commit is contained in:
Mikhail Zarechenskiy
2018-03-15 10:54:16 +03:00
parent 50027225a1
commit 663b417c5a
2 changed files with 24 additions and 0 deletions
@@ -0,0 +1,21 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. 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.resolve.calls.tower
import org.jetbrains.kotlin.resolve.calls.components.InferenceSession
import org.jetbrains.kotlin.resolve.calls.model.CallResolutionResult
abstract class ManyCandidatesResolver : InferenceSession {
private val partiallyResolvedCalls = arrayListOf<CallResolutionResult>()
override fun shouldFixTypeVariables(): Boolean {
return false
}
override fun addPartiallyResolvedCall(call: CallResolutionResult) {
partiallyResolvedCalls.add(call)
}
}
@@ -5,16 +5,19 @@
package org.jetbrains.kotlin.resolve.calls.components
import org.jetbrains.kotlin.resolve.calls.inference.NewConstraintSystem
import org.jetbrains.kotlin.resolve.calls.model.CallResolutionResult
interface InferenceSession {
companion object {
val default = object : InferenceSession {
override fun prepareBeforeCompletion(commonSystem: NewConstraintSystem) {}
override fun shouldFixTypeVariables(): Boolean = false
override fun addPartiallyResolvedCall(call: CallResolutionResult) {}
}
}
fun prepareBeforeCompletion(commonSystem: NewConstraintSystem)
fun shouldFixTypeVariables(): Boolean
fun addPartiallyResolvedCall(call: CallResolutionResult)
}