Fix minor compile warnings
This commit is contained in:
+2
-3
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.resolve.calls.inference.components
|
||||
import org.jetbrains.kotlin.types.AbstractNullabilityChecker
|
||||
import org.jetbrains.kotlin.types.AbstractTypeChecker
|
||||
import org.jetbrains.kotlin.types.AbstractTypeCheckerContext
|
||||
import org.jetbrains.kotlin.types.checker.*
|
||||
import org.jetbrains.kotlin.types.model.*
|
||||
|
||||
abstract class AbstractTypeCheckerContextForConstraintSystem : AbstractTypeCheckerContext(), TypeSystemInferenceExtensionContext {
|
||||
@@ -86,9 +85,9 @@ abstract class AbstractTypeCheckerContextForConstraintSystem : AbstractTypeCheck
|
||||
// extract type variable only from type like Captured(out T)
|
||||
private fun extractTypeVariableForSubtype(type: KotlinTypeMarker): KotlinTypeMarker? {
|
||||
|
||||
val type = type.asSimpleType()?.asCapturedType() ?: return null
|
||||
val typeMarker = type.asSimpleType()?.asCapturedType() ?: return null
|
||||
|
||||
val projection = type.typeConstructorProjection()
|
||||
val projection = typeMarker.typeConstructorProjection()
|
||||
return if (projection.getVariance() == TypeVariance.OUT)
|
||||
projection.getType().takeIf { it is SimpleTypeMarker && isMyTypeVariable(it) }?.asSimpleType()
|
||||
else
|
||||
|
||||
+6
-2
@@ -21,7 +21,6 @@ import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.resolve.calls.components.ClassicTypeSystemContextForCS
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilder
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.SimpleConstraintSystemConstraintPosition
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.TypeVariableFromCallableDescriptor
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.substitute
|
||||
import org.jetbrains.kotlin.resolve.calls.results.SimpleConstraintSystem
|
||||
@@ -52,7 +51,12 @@ class SimpleConstraintSystemImpl(constraintInjector: ConstraintInjector, builtIn
|
||||
}
|
||||
|
||||
override fun addSubtypeConstraint(subType: UnwrappedType, superType: UnwrappedType) {
|
||||
csBuilder.addSubtypeConstraint(subType, superType, SimpleConstraintSystemConstraintPosition)
|
||||
csBuilder.addSubtypeConstraint(
|
||||
subType,
|
||||
superType,
|
||||
@Suppress("DEPRECATION")
|
||||
org.jetbrains.kotlin.resolve.calls.inference.model.SimpleConstraintSystemConstraintPosition
|
||||
)
|
||||
}
|
||||
|
||||
override fun hasContradiction() = csBuilder.hasContradiction
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ open class OverloadingConflictResolver<C : Any>(
|
||||
}
|
||||
}
|
||||
if (result == null) return null
|
||||
if (any { it != result && isNotWorse(it, result!!) }) {
|
||||
if (any { it != result && isNotWorse(it, result) }) {
|
||||
return null
|
||||
}
|
||||
return result
|
||||
|
||||
@@ -121,6 +121,7 @@ abstract class LexicalScopeStorage(
|
||||
val result = ArrayList<TDescriptor>(1)
|
||||
var rest: IntList? = this
|
||||
do {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
result.add(rest!!.last.descriptorByIndex() as TDescriptor)
|
||||
rest = rest.prev
|
||||
} while (rest != null)
|
||||
|
||||
Reference in New Issue
Block a user