From a819104d81141af5954690e99afde8d183f399df Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Mon, 2 Dec 2019 16:39:02 +0300 Subject: [PATCH] JVM_IR: generate nullability assertions for private operators If a fun is private, we still generate nullability assertions in case when it is an operator. This is for bug-to-bug compatibility with 1.3. --- .../jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt index 8ae63d18e94..158fa595906 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt @@ -215,7 +215,7 @@ class ExpressionCodegen( return val notCallableFromJava = inlinedInto != null || - Visibilities.isPrivate(irFunction.visibility) || + (Visibilities.isPrivate(irFunction.visibility) && !(irFunction is IrSimpleFunction && irFunction.isOperator)) || irFunction.origin.isSynthetic || // TODO: refine this condition to not generate nullability assertions on parameters // corresponding to captured variables and anonymous object super constructor arguments