From 64a275cf834bf9a22ce182f6c4a7217b0e03df51 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Sun, 20 Jun 2021 21:57:07 -0700 Subject: [PATCH] FIR: fix type comparator As many other places did, this one is supposed to return the diff value if the given two intersection types' sizes are different. --- .../org/jetbrains/kotlin/fir/types/ConeKotlinTypeComparator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/ConeKotlinTypeComparator.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/ConeKotlinTypeComparator.kt index 6017acde49d..c8df69e13dd 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/ConeKotlinTypeComparator.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/ConeKotlinTypeComparator.kt @@ -136,7 +136,7 @@ object ConeKotlinTypeComparator : Comparator { } val sizeDiff = a.intersectedTypes.size - b.intersectedTypes.size if (sizeDiff != 0) { - return 0 + return sizeDiff } // Can't compare individual types from each side, since their orders are not guaranteed. return a.hashCode() - b.hashCode()