From b839e2680ebbbbba8657678e6cda317d8f4fd82a Mon Sep 17 00:00:00 2001 From: Igor Yakovlev Date: Thu, 7 Mar 2024 11:26:47 +0100 Subject: [PATCH] [Wasm] Fix equality on Nothing type Fixed #KT-66104 --- .../org/jetbrains/kotlin/backend/wasm/lower/BuiltInsLowering.kt | 2 +- compiler/testData/codegen/box/function/eqeq.kt | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/BuiltInsLowering.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/BuiltInsLowering.kt index 1a3d4fb69c0..0e980f4c4eb 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/BuiltInsLowering.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/BuiltInsLowering.kt @@ -97,7 +97,7 @@ class BuiltInsLowering(val context: WasmBackendContext) : FileLoweringPass { } // For eqeqSymbol use overridden `Any.equals(Any?)` if there is any. - if (call.symbol === irBuiltins.eqeqSymbol && !lhsType.isNullable()) { + if (call.symbol === irBuiltins.eqeqSymbol && !lhsType.isNullable() && !lhsType.isNothing()) { return irCall(call, lhsType.findEqualsMethod().symbol, argumentsAsReceivers = true) } diff --git a/compiler/testData/codegen/box/function/eqeq.kt b/compiler/testData/codegen/box/function/eqeq.kt index da9a1de5852..086f3ac7b1d 100644 --- a/compiler/testData/codegen/box/function/eqeq.kt +++ b/compiler/testData/codegen/box/function/eqeq.kt @@ -2,8 +2,6 @@ * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE file. */ -// KT-66104: Internal error in file lowering: java.util.NoSuchElementException: Sequence contains no element matching the predicate. -// IGNORE_BACKEND: WASM // WITH_STDLIB import kotlin.test.*