diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java index 25b92ce0b9a..3348073079e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java @@ -812,7 +812,10 @@ public abstract class MemberCodegen? { + return Type(s) + } + + inline fun action(crossinline f: () -> Type<*>?) = f()!! + + class Type(val x: String) + +} + +fun box() = Test.test() \ No newline at end of file diff --git a/compiler/testData/codegen/box/jvmStatic/kt21246a.kt b/compiler/testData/codegen/box/jvmStatic/kt21246a.kt new file mode 100644 index 00000000000..2c188e8dfd3 --- /dev/null +++ b/compiler/testData/codegen/box/jvmStatic/kt21246a.kt @@ -0,0 +1,15 @@ +// WITH_RUNTIME +// TARGET_BACKEND: JVM + +object Test { + + fun test() = { createWildcard("OK") }() + + @JvmStatic + private fun createWildcard(s: String) = Type(s).x + + class Type(val x: String) + +} + +fun box() = Test.test() \ No newline at end of file diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index c5d8bd20ea2..d8c53845cda 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -11081,6 +11081,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes doTest(fileName); } + @TestMetadata("kt21246.kt") + public void testKt21246() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt21246.kt"); + doTest(fileName); + } + + @TestMetadata("kt21246a.kt") + public void testKt21246a() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt21246a.kt"); + doTest(fileName); + } + @TestMetadata("kt9897_static.kt") public void testKt9897_static() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt9897_static.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index c825a58398f..a512540dc79 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -11081,6 +11081,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("kt21246.kt") + public void testKt21246() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt21246.kt"); + doTest(fileName); + } + + @TestMetadata("kt21246a.kt") + public void testKt21246a() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt21246a.kt"); + doTest(fileName); + } + @TestMetadata("kt9897_static.kt") public void testKt9897_static() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt9897_static.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index f7e7a82a392..ac76b04203f 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -11081,6 +11081,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes doTest(fileName); } + @TestMetadata("kt21246.kt") + public void testKt21246() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt21246.kt"); + doTest(fileName); + } + + @TestMetadata("kt21246a.kt") + public void testKt21246a() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt21246a.kt"); + doTest(fileName); + } + @TestMetadata("kt9897_static.kt") public void testKt9897_static() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/jvmStatic/kt9897_static.kt");