From 2aa1c40de45d680366ae34f80156162ec598e3a5 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Tue, 17 Dec 2019 12:16:13 +0300 Subject: [PATCH] Avoid checking trivial incorporated constraints --- .../resolve/calls/inference/components/ConstraintInjector.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/ConstraintInjector.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/ConstraintInjector.kt index 4dad5c63232..6e3f465e622 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/ConstraintInjector.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/ConstraintInjector.kt @@ -182,6 +182,7 @@ class ConstraintInjector( // from ConstraintIncorporator.Context override fun addNewIncorporatedConstraint(lowerType: KotlinTypeMarker, upperType: KotlinTypeMarker) { + if (lowerType === upperType) return if (c.isAllowedType(lowerType) && c.isAllowedType(upperType)) { runIsSubtypeOf(lowerType, upperType) }