From 030866cb0b9b32c3fce9273b22d6085307d709a6 Mon Sep 17 00:00:00 2001 From: Kirill Rakhman Date: Tue, 11 Apr 2023 16:50:06 +0200 Subject: [PATCH] [FIR] Rewrite ConeKotlinType.hasError() using ConeKotlinType.contains() --- .../src/org/jetbrains/kotlin/fir/types/ConeTypeUtils.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeTypeUtils.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeTypeUtils.kt index 485e82f3648..88a1b4a5a45 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeTypeUtils.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeTypeUtils.kt @@ -131,8 +131,4 @@ fun ConeKotlinType.renderReadableWithFqNames(): String { return builder.toString() } -fun ConeKotlinType.hasError(): Boolean = when (this) { - is ConeErrorType -> true - is ConeFlexibleType -> lowerBound.hasError() || upperBound.hasError() - else -> typeArguments.any { it is ConeKotlinType && it.hasError() } -} +fun ConeKotlinType.hasError(): Boolean = contains { it is ConeErrorType }