Remove TypeSystemContext::mayBeTypeVariable optimization
It doesn't work now since anyway it's required to obtain type constructor At the same time, now it's not very expensive to obtain the constructor since it's just a lookup tag
This commit is contained in:
-5
@@ -34,11 +34,6 @@ class ClassicTypeSystemContextForCS(override val builtIns: KotlinBuiltIns) : Typ
|
||||
return this.freshTypeConstructor
|
||||
}
|
||||
|
||||
override fun KotlinTypeMarker.mayBeTypeVariable(): Boolean {
|
||||
require(this is KotlinType, this::errorMessage)
|
||||
return this.constructor is TypeVariableTypeConstructor
|
||||
}
|
||||
|
||||
override fun createCapturedType(
|
||||
constructorProjection: TypeArgumentMarker,
|
||||
constructorSupertypes: List<KotlinTypeMarker>,
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ class ConstraintInjector(
|
||||
|
||||
// from AbstractTypeCheckerContextForConstraintSystem
|
||||
override fun isMyTypeVariable(type: SimpleTypeMarker): Boolean =
|
||||
type.mayBeTypeVariable() && c.allTypeVariables.containsKey(type.typeConstructor())
|
||||
c.allTypeVariables.containsKey(type.typeConstructor())
|
||||
|
||||
override fun addUpperConstraint(typeVariable: TypeConstructorMarker, superType: KotlinTypeMarker) =
|
||||
addConstraint(typeVariable, superType, UPPER)
|
||||
|
||||
Reference in New Issue
Block a user