Migration fixes for new inference
This commit is contained in:
+2
-1
@@ -70,6 +70,7 @@ import org.jetbrains.kotlin.resolve.lazy.declarations.FileBasedDeclarationProvid
|
||||
import org.jetbrains.kotlin.serialization.deserialization.DeserializationConfiguration
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
import java.util.*
|
||||
import kotlin.reflect.KFunction1
|
||||
|
||||
object TopDownAnalyzerFacadeForJVM {
|
||||
@JvmStatic
|
||||
@@ -161,7 +162,7 @@ object TopDownAnalyzerFacadeForJVM {
|
||||
|
||||
val configureJavaClassFinder =
|
||||
if (configuration.getBoolean(JVMConfigurationKeys.USE_JAVAC)) StorageComponentContainer::useJavac
|
||||
else null
|
||||
else null as KFunction1<StorageComponentContainer, Unit>?
|
||||
|
||||
val dependencyModule = if (separateModules) {
|
||||
val dependenciesContext = ContextForNewModule(
|
||||
|
||||
+3
-1
@@ -37,7 +37,9 @@ fun createJvmProfile(targetRoot: File, version: Int): Profile = Profile("JVM$ver
|
||||
fun createJsProfile(targetRoot: File): Profile = Profile("JS", JsPlatformEvaluator(), File(targetRoot, "js"))
|
||||
|
||||
val profileEvaluators: Map<String, () -> Evaluator> =
|
||||
listOf(6, 7, 8).associateBy({ version -> "JVM$version" }, { version -> { JvmPlatformEvaluator(version) } }) + ("JS" to { JsPlatformEvaluator() })
|
||||
listOf(6, 7, 8)
|
||||
.associateBy({ version -> "JVM$version" }, { version -> { JvmPlatformEvaluator(version) } })
|
||||
.plus<String, () -> PlatformEvaluator>(("JS" to { JsPlatformEvaluator() }))
|
||||
|
||||
fun createProfile(name: String, targetRoot: File): Profile {
|
||||
val (profileName, evaluator) = profileEvaluators.entries.firstOrNull { it.key.equals(name, ignoreCase = true) } ?: throw IllegalArgumentException("Profile with name '$name' is not supported")
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user