diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index ca07a2ff6b5..b510296efee 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -19787,6 +19787,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nestedIndyLambdas.kt"); } + @Test + @TestMetadata("nullabilityAssertions.kt") + public void testNullabilityAssertions() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nullabilityAssertions.kt"); + } + @Test @TestMetadata("primitiveValueParameters.kt") public void testPrimitiveValueParameters() throws Exception { diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/nullabilityAssertions.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/nullabilityAssertions.kt new file mode 100644 index 00000000000..aa4b937e701 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/nullabilityAssertions.kt @@ -0,0 +1,24 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// LAMBDAS: INDY +// WITH_RUNTIME +// FILE: nullabilityAssertions.kt +fun box(): String { + val fn: (String) -> String = { it } + try { + J.test(fn) + } catch (e: NullPointerException) { + return "OK" + } + + return "Should throw NullPointerException" +} + +// FILE: J.java +import kotlin.jvm.functions.Function1; + +public class J { + public static void test(Function1 fn) { + fn.invoke(null); + } +} diff --git a/compiler/testData/codegen/box/invokedynamic/sam/nullabilityAssertions.kt b/compiler/testData/codegen/box/invokedynamic/sam/nullabilityAssertions.kt index b2f0ad4784f..9effb947012 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/nullabilityAssertions.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/nullabilityAssertions.kt @@ -3,8 +3,6 @@ // SAM_CONVERSIONS: INDY // FILE: nullabilityAssertions.kt fun box(): String { - fun justSomeLocalFun() {} - try { A.bar {} } catch (e: NullPointerException) { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 34067e8e477..eb2e084e999 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -19787,6 +19787,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nestedIndyLambdas.kt"); } + @Test + @TestMetadata("nullabilityAssertions.kt") + public void testNullabilityAssertions() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nullabilityAssertions.kt"); + } + @Test @TestMetadata("primitiveValueParameters.kt") public void testPrimitiveValueParameters() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 05ecd8000c8..36794d3d304 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -19787,6 +19787,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nestedIndyLambdas.kt"); } + @Test + @TestMetadata("nullabilityAssertions.kt") + public void testNullabilityAssertions() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nullabilityAssertions.kt"); + } + @Test @TestMetadata("primitiveValueParameters.kt") public void testPrimitiveValueParameters() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index e5101b1bdb2..a56ad4d5818 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16577,6 +16577,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nestedIndyLambdas.kt"); } + @TestMetadata("nullabilityAssertions.kt") + public void testNullabilityAssertions() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nullabilityAssertions.kt"); + } + @TestMetadata("primitiveValueParameters.kt") public void testPrimitiveValueParameters() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/lambdas/primitiveValueParameters.kt");