[NI] Fix recursion in contract declaration analysis.

#KT-30410 Fixed
This commit is contained in:
Dmitriy Novozhilov
2019-05-21 10:58:29 +03:00
parent 8d5c61f3ab
commit fb77e1f0bd
5 changed files with 50 additions and 14 deletions
@@ -55,6 +55,8 @@ interface KotlinResolutionCallbacks {
val inferenceSession: InferenceSession
fun getExpectedTypeFromAsExpressionAndRecordItInTrace(resolvedAtom: ResolvedCallAtom): UnwrappedType?
fun disableContractsIfNecessary(resolvedAtom: ResolvedCallAtom)
}
interface SamConversionTransformer {
@@ -133,7 +133,10 @@ class KotlinCallCompleter(
val candidate = candidates.singleOrNull()
// this is needed at least for non-local return checker, because when we analyze lambda we should already bind descriptor for outer call
candidate?.resolvedCall?.let { resolutionCallbacks.bindStubResolvedCallForCandidate(it) }
candidate?.resolvedCall?.let {
resolutionCallbacks.bindStubResolvedCallForCandidate(it)
resolutionCallbacks.disableContractsIfNecessary(it)
}
return candidate ?: factory.createErrorCandidate().forceResolution()
}