diff --git a/compiler/testData/codegen/box/argumentOrder/kt9277.kt b/compiler/testData/codegen/box/argumentOrder/kt9277.kt new file mode 100644 index 00000000000..eb08fb7b719 --- /dev/null +++ b/compiler/testData/codegen/box/argumentOrder/kt9277.kt @@ -0,0 +1,13 @@ +// KT-9277 Unexpected NullPointerException in an invocaton with named arguments + +fun box(): String { + foo(null) + + return "OK" +} + +fun foo(x : Int?){ + bar(z = x ?: return, y = x) +} + +fun bar(y : Int, z : Int) {} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java index 3e55220381f..e388bccfcfe 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java @@ -79,6 +79,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("kt9277.kt") + public void testKt9277() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/kt9277.kt"); + doTest(fileName); + } + @TestMetadata("lambdaMigration.kt") public void testLambdaMigration() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/lambdaMigration.kt");