[NI] Avoid computing few things for simple calls without type variables
This commit is contained in:
+5
-1
@@ -256,7 +256,7 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext,
|
||||
}
|
||||
|
||||
override fun typeSubstitutorByTypeConstructor(map: Map<TypeConstructorMarker, KotlinTypeMarker>): TypeSubstitutorMarker {
|
||||
if (map.isEmpty()) return ConeSubstitutor.Empty
|
||||
if (map.isEmpty()) return createEmptySubstitutor()
|
||||
return object : AbstractConeSubstitutor(),
|
||||
TypeSubstitutorMarker {
|
||||
override fun substituteType(type: ConeKotlinType): ConeKotlinType? {
|
||||
@@ -266,6 +266,10 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext,
|
||||
}
|
||||
}
|
||||
|
||||
override fun createEmptySubstitutor(): TypeSubstitutorMarker {
|
||||
return ConeSubstitutor.Empty
|
||||
}
|
||||
|
||||
override fun TypeSubstitutorMarker.safeSubstitute(type: KotlinTypeMarker): KotlinTypeMarker {
|
||||
if (this === NoSubstitutor) return type
|
||||
require(this is ConeSubstitutor)
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.fir.types.impl.FirResolvedTypeRefImpl
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.calls.components.InferenceSession
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.buildAbstractResultingSubstitutor
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.components.EmptySubstitutor
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.components.KotlinConstraintSystemCompleter
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.SimpleConstraintSystemConstraintPosition
|
||||
import org.jetbrains.kotlin.types.model.StubTypeMarker
|
||||
|
||||
Reference in New Issue
Block a user