Migration fixes for new inference

This commit is contained in:
Mikhail Zarechenskiy
2018-03-27 13:32:39 +03:00
parent ae35a3b324
commit e1d75d5581
5 changed files with 10 additions and 6 deletions
@@ -318,7 +318,7 @@ class LazyModuleDependencies<M : ModuleInfo>(
) : ModuleDependencies {
private val dependencies = storageManager.createLazyValue {
val moduleDescriptor = resolverForProject.descriptorForModule(module)
buildSequence {
buildSequence<ModuleDescriptorImpl> {
if (firstDependency != null) {
yield(resolverForProject.descriptorForModule(firstDependency))
}
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.resolve.calls.context.CallPosition
import org.jetbrains.kotlin.resolve.calls.context.ResolutionContext
import org.jetbrains.kotlin.resolve.calls.inference.isCaptured
import org.jetbrains.kotlin.resolve.calls.inference.wrapWithCapturingSubstitution
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.calls.model.VariableAsFunctionResolvedCall
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeConstructorSubstitution
@@ -56,11 +57,11 @@ fun ResolutionContext<*>.reportTypeMismatchDueToTypeProjection(
callPosition.resolvedCall, { f: CallableDescriptor ->
getEffectiveExpectedType(f.valueParameters[callPosition.valueParameter.index], callPosition.valueArgument, this)
})
is CallPosition.ExtensionReceiverPosition -> Pair(
is CallPosition.ExtensionReceiverPosition -> Pair<ResolvedCall<*>, (CallableDescriptor) -> KotlinType?>(
callPosition.resolvedCall, { f: CallableDescriptor ->
f.extensionReceiverParameter?.type
})
is CallPosition.PropertyAssignment -> Pair(
is CallPosition.PropertyAssignment -> Pair<ResolvedCall<out CallableDescriptor>, (CallableDescriptor) -> KotlinType?>(
callPosition.leftPart.getResolvedCall(trace.bindingContext) ?: return false, { f: CallableDescriptor ->
(f as? PropertyDescriptor)?.setter?.valueParameters?.get(0)?.type
})
@@ -704,7 +704,7 @@ class DoubleColonExpressionResolver(
?.apply { commitTrace() }?.results
}
val resultSequence = buildSequence {
val resultSequence = buildSequence<ResolutionResultsAndTraceCommitCallback> {
when (lhs) {
is DoubleColonLHS.Type -> {
val classifier = lhsType.constructor.declarationDescriptor