diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java index 74951a1e168..31ec62d52a7 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java @@ -318,6 +318,10 @@ public class PropertyCodegen { return false; } + if (kind == OwnerKind.ERASED_INLINE_CLASS) { + return false; + } + if (p instanceof KtProperty && ((KtProperty) p).hasDelegate()) { generatePropertyDelegateAccess((KtProperty) p, descriptor, delegateAnnotations); } diff --git a/compiler/testData/codegen/bytecodeListing/inlineClasses/shapeOfInlineClassWithPrimitive.kt b/compiler/testData/codegen/bytecodeListing/inlineClasses/shapeOfInlineClassWithPrimitive.kt new file mode 100644 index 00000000000..815b0cec570 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/inlineClasses/shapeOfInlineClassWithPrimitive.kt @@ -0,0 +1,7 @@ +// !LANGUAGE: +InlineClasses + +inline class Foo(val l: Long) { + fun empty() {} + fun param(x: Double) {} + fun Any.extension(y: String) {} +} \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/inlineClasses/shapeOfInlineClassWithPrimitive.txt b/compiler/testData/codegen/bytecodeListing/inlineClasses/shapeOfInlineClassWithPrimitive.txt new file mode 100644 index 00000000000..ad887512f60 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/inlineClasses/shapeOfInlineClassWithPrimitive.txt @@ -0,0 +1,16 @@ +@kotlin.Metadata +public final static class Foo$Erased { + public final static method empty(p0: long): void + public final static method extension(p0: long, @org.jetbrains.annotations.NotNull p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.String): void + public final static method param(p0: long, p1: double): void +} + +@kotlin.Metadata +public final class Foo { + private final field l: long + public method (p0: long): void + public final method empty(): void + public final method extension(@org.jetbrains.annotations.NotNull p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: java.lang.String): void + public final method getL(): long + public final method param(p0: double): void +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java index 1366afb4301..eafba6acaeb 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java @@ -259,6 +259,21 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { } } + @TestMetadata("compiler/testData/codegen/bytecodeListing/inlineClasses") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineClasses extends AbstractBytecodeListingTest { + public void testAllFilesPresentInInlineClasses() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("shapeOfInlineClassWithPrimitive.kt") + public void testShapeOfInlineClassWithPrimitive() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/inlineClasses/shapeOfInlineClassWithPrimitive.kt"); + doTest(fileName); + } + } + @TestMetadata("compiler/testData/codegen/bytecodeListing/specialBridges") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)