Fix minor compile warnings

This commit is contained in:
Dmitry Gridin
2019-04-17 17:48:26 +07:00
parent 79793a4bda
commit 37c856290f
226 changed files with 618 additions and 479 deletions
@@ -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
@@ -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
@@ -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)