[NI] Clean up after merge with 3998e842

This commit is contained in:
Mikhail Zarechenskiy
2019-04-02 12:17:42 +03:00
parent c458393e2f
commit 63bdabcfae
4 changed files with 19 additions and 28 deletions
@@ -9,7 +9,6 @@ import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.resolve.calls.inference.NewConstraintSystem
import org.jetbrains.kotlin.resolve.calls.inference.components.KotlinConstraintSystemCompleter
import org.jetbrains.kotlin.resolve.calls.inference.components.KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode
import org.jetbrains.kotlin.resolve.calls.inference.components.TrivialConstraintTypeInferenceOracle
import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage.Empty.hasContradiction
import org.jetbrains.kotlin.resolve.calls.inference.model.ExpectedTypeConstraintPosition
import org.jetbrains.kotlin.resolve.calls.model.*
@@ -18,11 +17,12 @@ import org.jetbrains.kotlin.types.ErrorUtils
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.UnwrappedType
import org.jetbrains.kotlin.types.model.TypeSystemInferenceExtensionContext
import org.jetbrains.kotlin.types.model.isIntegerLiteralTypeConstructor
import org.jetbrains.kotlin.types.model.typeConstructor
class KotlinCallCompleter(
private val postponedArgumentsAnalyzer: PostponedArgumentsAnalyzer,
private val kotlinConstraintSystemCompleter: KotlinConstraintSystemCompleter,
private val trivialConstraintTypeInferenceOracle: TrivialConstraintTypeInferenceOracle
private val kotlinConstraintSystemCompleter: KotlinConstraintSystemCompleter
) {
fun runCompletion(
@@ -201,8 +201,8 @@ class KotlinCallCompleter(
val variableWithConstraints = csBuilder.currentStorage().notFixedTypeVariables[constructor] ?: return false
val constraints = variableWithConstraints.constraints
return constraints.isNotEmpty() && constraints.all {
with(context) { !it.type.typeConstructor().isIntegerLiteralTypeConstructor() } &&
it.kind.isLower() && csBuilder.isProperType(it.type)
!it.type.typeConstructor(context).isIntegerLiteralTypeConstructor(context) &&
it.kind.isLower() && csBuilder.isProperType(it.type)
}
}
@@ -122,15 +122,6 @@ class ConstraintIncorporator(
null,
CaptureStatus.FOR_INCORPORATION
)
// val newCapturedTypeConstructor = NewCapturedTypeConstructor(
// TypeProjectionImpl(Variance.OUT_VARIANCE, otherConstraint.type),
// listOf(otherConstraint.type)
// )
// val temporaryCapturedType = NewCapturedType(
// CaptureStatus.FOR_INCORPORATION,
// newCapturedTypeConstructor,
// lowerType = null
// )
baseConstraintType.substitute(this, otherVariable, temporaryCapturedType)
}
ConstraintKind.LOWER -> {
@@ -141,15 +132,6 @@ class ConstraintIncorporator(
CaptureStatus.FOR_INCORPORATION
)
// val newCapturedTypeConstructor = NewCapturedTypeConstructor(
// TypeProjectionImpl(Variance.IN_VARIANCE, otherConstraint.type),
// emptyList()
// )
// val temporaryCapturedType = NewCapturedType(
// CaptureStatus.FOR_INCORPORATION,
// newCapturedTypeConstructor,
// lowerType = otherConstraint.type
// )
baseConstraintType.substitute(this, otherVariable, temporaryCapturedType)
}
}
@@ -7,12 +7,9 @@ package org.jetbrains.kotlin.resolve.calls.inference.components
import org.jetbrains.kotlin.resolve.calls.inference.model.Constraint
import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintKind
import org.jetbrains.kotlin.resolve.calls.inference.model.NewTypeVariable
import org.jetbrains.kotlin.types.UnwrappedType
import org.jetbrains.kotlin.types.model.KotlinTypeMarker
import org.jetbrains.kotlin.types.typeUtil.contains
import org.jetbrains.kotlin.types.typeUtil.isNothing
import org.jetbrains.kotlin.types.typeUtil.isNullableNothing
import org.jetbrains.kotlin.types.model.TypeSystemInferenceExtensionContext
import org.jetbrains.kotlin.types.model.TypeSystemInferenceExtensionContextDelegate
class TrivialConstraintTypeInferenceOracle(context: TypeSystemInferenceExtensionContextDelegate) :
TypeSystemInferenceExtensionContext by context {
@@ -0,0 +1,12 @@
/*
* Copyright 2010-2019 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.types.model
fun KotlinTypeMarker.typeConstructor(context: TypeSystemContext): TypeConstructorMarker =
with(context) { typeConstructor() }
fun TypeConstructorMarker.isIntegerLiteralTypeConstructor(context: TypeSystemContext): Boolean =
with(context) { isIntegerLiteralTypeConstructor() }