From 33ab2299f99b6392a371d2901a9a205996731d16 Mon Sep 17 00:00:00 2001 From: Mads Ager Date: Thu, 10 Sep 2020 16:00:46 +0200 Subject: [PATCH] [IR] Fix the type of the default argument mask condition. On JVM and JS we can get away with using an Int but it really should be a Boolean and Native reasonably insists on that. --- .../kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt index c4a75a59e6a..8c094a17d0e 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt @@ -193,7 +193,7 @@ open class DefaultArgumentStubGenerator( // // This control flow limits us to an if-then (without an else), and this together with the // restriction on loading the parameter in the default case means we cannot create any temporaries. - +irIfThen(defaultFlag, irSet(parameter.symbol, default)) + +irIfThen(irNotEquals(defaultFlag, irInt(0)), irSet(parameter.symbol, default)) return parameter }