Optimize ConstraintInjector::isMyTypeVariable

Do not look into the map for constructors that are not
type variables
This commit is contained in:
Denis Zharkov
2019-06-05 14:51:13 +03:00
parent b43f717f6d
commit 3c8ed21e59
5 changed files with 24 additions and 8 deletions
@@ -246,6 +246,11 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext,
return this.typeConstructor
}
override fun KotlinTypeMarker.mayBeTypeVariable(): Boolean {
require(this is ConeKotlinType)
return this is ConeTypeVariableType
}
override fun CapturedTypeMarker.typeConstructorProjection(): TypeArgumentMarker {
require(this is ConeCapturedType)
return this.constructor.projection
@@ -310,4 +315,4 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext,
override fun TypeConstructorMarker.isCapturedTypeConstructor(): Boolean {
return this is ConeCapturedTypeConstructor
}
}
}