From 19299daacdbe14177a0b6c31e3fd4c9534d8c851 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 19 Jul 2013 23:09:55 +0400 Subject: [PATCH] Deserialize annotations on class object properties Class object properties' backing fields are generated into static fields of the containing class, not into fields of class object. For fields we now store the flag which, if set, tells that this field should be looked for in the containing class --- .../jet/codegen/JavaSerializerExtension.java | 6 +- .../org/jetbrains/jet/codegen/MemberMap.java | 18 +++++- .../jet/codegen/PropertyCodegen.java | 3 +- .../src/java_descriptors.proto | 4 ++ .../serialization/JavaProtoBuf.java | 57 +++++++++++++++++++ .../serialization/JavaProtoBufUtil.java | 17 +++++- .../AnnotationDescriptorDeserializer.java | 11 ++-- .../classMembers/ClassObjectPropertyField.kt | 9 +++ .../classMembers/ClassObjectPropertyField.txt | 16 ++++++ .../ClassObjectPropertyNoField.kt | 10 ++++ .../ClassObjectPropertyNoField.txt | 15 +++++ .../classMembers/DelegatedProperty.kt | 9 +++ .../classMembers/DelegatedProperty.txt | 11 ++++ .../packageMembers/DelegatedProperty.kt | 7 +++ .../packageMembers/DelegatedProperty.txt | 8 +++ .../LoadCompiledKotlinTestGenerated.java | 20 +++++++ ...esolveNamespaceComparingTestGenerated.java | 20 +++++++ 17 files changed, 229 insertions(+), 12 deletions(-) create mode 100644 compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.kt create mode 100644 compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.txt create mode 100644 compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.kt create mode 100644 compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.txt create mode 100644 compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.kt create mode 100644 compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.txt create mode 100644 compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.kt create mode 100644 compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.txt diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/JavaSerializerExtension.java b/compiler/backend/src/org/jetbrains/jet/codegen/JavaSerializerExtension.java index ff3b77704dc..8cc04a2cd5c 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/JavaSerializerExtension.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/JavaSerializerExtension.java @@ -66,19 +66,23 @@ public class JavaSerializerExtension extends SerializerExtension { Pair field = memberMap.getFieldOfProperty(property); Type fieldType; String fieldName; + boolean isStaticInOuter; String syntheticMethodName; if (field != null) { fieldType = field.first; fieldName = field.second; + isStaticInOuter = memberMap.isStaticFieldInOuterClass(property); syntheticMethodName = null; } else { fieldType = null; fieldName = null; + isStaticInOuter = false; syntheticMethodName = memberMap.getSyntheticMethodNameOfProperty(property); } - JavaProtoBufUtil.savePropertySignature(proto, fieldType, fieldName, syntheticMethodName, getterMethod, setterMethod, nameTable); + JavaProtoBufUtil.savePropertySignature(proto, fieldType, fieldName, isStaticInOuter, syntheticMethodName, getterMethod, + setterMethod, nameTable); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/MemberMap.java b/compiler/backend/src/org/jetbrains/jet/codegen/MemberMap.java index 65f2452804b..047bf7d54fd 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/MemberMap.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/MemberMap.java @@ -26,15 +26,14 @@ import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; import org.jetbrains.jet.lang.resolve.name.Name; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; +import java.util.*; public final class MemberMap { private final Map methodForFunction = new HashMap(); private final Map> fieldForProperty = new HashMap>(); private final Map syntheticMethodNameForProperty = new HashMap(); private final Map srcClassNameForCallable = new HashMap(); + private final Set staticFieldInOuterClass = new HashSet(); @NotNull public static MemberMap union(@NotNull Collection maps) { @@ -55,6 +54,10 @@ public final class MemberMap { for (Map.Entry entry : map.srcClassNameForCallable.entrySet()) { result.recordSrcClassNameForCallable(entry.getKey(), entry.getValue()); } + + for (PropertyDescriptor property : map.staticFieldInOuterClass) { + result.recordStaticFieldInOuterClass(property); + } } return result; @@ -80,6 +83,11 @@ public final class MemberMap { assert old == null : "Duplicate src class name for callable: " + descriptor + "; " + old; } + public void recordStaticFieldInOuterClass(@NotNull PropertyDescriptor property) { + boolean added = staticFieldInOuterClass.add(property); + assert added : "Duplicate static field in outer class: " + property; + } + @Nullable public Method getMethodOfDescriptor(@NotNull FunctionDescriptor descriptor) { return methodForFunction.get(descriptor); @@ -100,6 +108,10 @@ public final class MemberMap { return srcClassNameForCallable.get(descriptor); } + public boolean isStaticFieldInOuterClass(@NotNull PropertyDescriptor property) { + return staticFieldInOuterClass.contains(property); + } + @Override public String toString() { return "Functions: " + methodForFunction.size() + diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java index 833d8ed528a..3fec8d7d34b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java @@ -180,6 +180,7 @@ public class PropertyCodegen extends GenerationStateAware { ImplementationBodyCodegen codegen = getParentBodyCodegen(classBodyCodegen); builder = codegen.v; backingFieldContext = codegen.context; + v.getMemberMap().recordStaticFieldInOuterClass(propertyDescriptor); } else { if (kind != OwnerKind.NAMESPACE || isDelegate) { modifiers |= ACC_PRIVATE; @@ -193,7 +194,7 @@ public class PropertyCodegen extends GenerationStateAware { String name = backingFieldContext.getFieldName(propertyDescriptor, isDelegate); - builder.getMemberMap().recordFieldOfProperty(propertyDescriptor, type, name); + v.getMemberMap().recordFieldOfProperty(propertyDescriptor, type, name); return builder.newField(element, modifiers, name, type.getDescriptor(), typeMapper.mapFieldSignature(jetType), defaultValue); diff --git a/compiler/frontend.java/serialization.java/src/java_descriptors.proto b/compiler/frontend.java/serialization.java/src/java_descriptors.proto index 569d01f9bac..4753b1f53d7 100644 --- a/compiler/frontend.java/serialization.java/src/java_descriptors.proto +++ b/compiler/frontend.java/serialization.java/src/java_descriptors.proto @@ -51,6 +51,10 @@ message JavaMethodSignature { message JavaFieldSignature { required int32 name = 1; required JavaType type = 2; + + // True iff this field is a backing field for a class object and is really present as a static + // field in the outer class, not as an instance field here + optional bool is_static_in_outer = 3 [default = false]; } message JavaPropertySignature { diff --git a/compiler/frontend.java/serialization.java/src/org/jetbrains/jet/descriptors/serialization/JavaProtoBuf.java b/compiler/frontend.java/serialization.java/src/org/jetbrains/jet/descriptors/serialization/JavaProtoBuf.java index 44fcdc57522..ea4cf407339 100644 --- a/compiler/frontend.java/serialization.java/src/org/jetbrains/jet/descriptors/serialization/JavaProtoBuf.java +++ b/compiler/frontend.java/serialization.java/src/org/jetbrains/jet/descriptors/serialization/JavaProtoBuf.java @@ -1016,6 +1016,10 @@ public final class JavaProtoBuf { // required .org.jetbrains.jet.descriptors.serialization.JavaType type = 2; boolean hasType(); org.jetbrains.jet.descriptors.serialization.JavaProtoBuf.JavaType getType(); + + // optional bool is_static_in_outer = 3 [default = false]; + boolean hasIsStaticInOuter(); + boolean getIsStaticInOuter(); } public static final class JavaFieldSignature extends com.google.protobuf.GeneratedMessageLite @@ -1056,9 +1060,20 @@ public final class JavaProtoBuf { return type_; } + // optional bool is_static_in_outer = 3 [default = false]; + public static final int IS_STATIC_IN_OUTER_FIELD_NUMBER = 3; + private boolean isStaticInOuter_; + public boolean hasIsStaticInOuter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public boolean getIsStaticInOuter() { + return isStaticInOuter_; + } + private void initFields() { name_ = 0; type_ = org.jetbrains.jet.descriptors.serialization.JavaProtoBuf.JavaType.getDefaultInstance(); + isStaticInOuter_ = false; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -1086,6 +1101,9 @@ public final class JavaProtoBuf { if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeMessage(2, type_); } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, isStaticInOuter_); + } } private int memoizedSerializedSize = -1; @@ -1102,6 +1120,10 @@ public final class JavaProtoBuf { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, type_); } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, isStaticInOuter_); + } memoizedSerializedSize = size; return size; } @@ -1208,6 +1230,8 @@ public final class JavaProtoBuf { bitField0_ = (bitField0_ & ~0x00000001); type_ = org.jetbrains.jet.descriptors.serialization.JavaProtoBuf.JavaType.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000002); + isStaticInOuter_ = false; + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -1249,6 +1273,10 @@ public final class JavaProtoBuf { to_bitField0_ |= 0x00000002; } result.type_ = type_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.isStaticInOuter_ = isStaticInOuter_; result.bitField0_ = to_bitField0_; return result; } @@ -1261,6 +1289,9 @@ public final class JavaProtoBuf { if (other.hasType()) { mergeType(other.getType()); } + if (other.hasIsStaticInOuter()) { + setIsStaticInOuter(other.getIsStaticInOuter()); + } return this; } @@ -1307,6 +1338,11 @@ public final class JavaProtoBuf { setType(subBuilder.buildPartial()); break; } + case 24: { + bitField0_ |= 0x00000004; + isStaticInOuter_ = input.readBool(); + break; + } } } } @@ -1377,6 +1413,27 @@ public final class JavaProtoBuf { return this; } + // optional bool is_static_in_outer = 3 [default = false]; + private boolean isStaticInOuter_ ; + public boolean hasIsStaticInOuter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public boolean getIsStaticInOuter() { + return isStaticInOuter_; + } + public Builder setIsStaticInOuter(boolean value) { + bitField0_ |= 0x00000004; + isStaticInOuter_ = value; + + return this; + } + public Builder clearIsStaticInOuter() { + bitField0_ = (bitField0_ & ~0x00000004); + isStaticInOuter_ = false; + + return this; + } + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.JavaFieldSignature) } diff --git a/compiler/frontend.java/serialization.java/src/org/jetbrains/jet/descriptors/serialization/JavaProtoBufUtil.java b/compiler/frontend.java/serialization.java/src/org/jetbrains/jet/descriptors/serialization/JavaProtoBufUtil.java index 61151ff146d..75f7645fd7d 100644 --- a/compiler/frontend.java/serialization.java/src/org/jetbrains/jet/descriptors/serialization/JavaProtoBufUtil.java +++ b/compiler/frontend.java/serialization.java/src/org/jetbrains/jet/descriptors/serialization/JavaProtoBufUtil.java @@ -113,6 +113,12 @@ public class JavaProtoBufUtil { return nameResolver.getName(proto.getExtension(JavaProtoBuf.srcClassName)); } + public static boolean isStaticFieldInOuter(@NotNull ProtoBuf.Callable proto) { + if (!proto.hasExtension(JavaProtoBuf.propertySignature)) return false; + JavaProtoBuf.JavaPropertySignature propertySignature = proto.getExtension(JavaProtoBuf.propertySignature); + return propertySignature.hasField() && propertySignature.getField().getIsStaticInOuter(); + } + public static void saveMethodSignature(@NotNull ProtoBuf.Callable.Builder proto, @NotNull Method method, @NotNull NameTable nameTable) { proto.setExtension(JavaProtoBuf.methodSignature, new Serializer(nameTable).methodSignature(method)); } @@ -121,13 +127,14 @@ public class JavaProtoBufUtil { @NotNull ProtoBuf.Callable.Builder proto, @Nullable Type fieldType, @Nullable String fieldName, + boolean isStaticInOuter, @Nullable String syntheticMethodName, @Nullable Method getter, @Nullable Method setter, @NotNull NameTable nameTable ) { proto.setExtension(JavaProtoBuf.propertySignature, - new Serializer(nameTable).propertySignature(fieldType, fieldName, syntheticMethodName, getter, setter)); + new Serializer(nameTable).propertySignature(fieldType, fieldName, isStaticInOuter, syntheticMethodName, getter, setter)); } public static void saveSrcClassName( @@ -164,6 +171,7 @@ public class JavaProtoBufUtil { public JavaProtoBuf.JavaPropertySignature propertySignature( @Nullable Type fieldType, @Nullable String fieldName, + boolean isStaticInOuter, @Nullable String syntheticMethodName, @Nullable Method getter, @Nullable Method setter @@ -172,7 +180,7 @@ public class JavaProtoBufUtil { if (fieldType != null) { assert fieldName != null : "Field name shouldn't be null when there's a field type: " + fieldType; - signature.setField(fieldSignature(fieldType, fieldName)); + signature.setField(fieldSignature(fieldType, fieldName, isStaticInOuter)); } if (syntheticMethodName != null) { @@ -190,10 +198,13 @@ public class JavaProtoBufUtil { } @NotNull - public JavaProtoBuf.JavaFieldSignature fieldSignature(@NotNull Type type, @NotNull String name) { + public JavaProtoBuf.JavaFieldSignature fieldSignature(@NotNull Type type, @NotNull String name, boolean isStaticInOuter) { JavaProtoBuf.JavaFieldSignature.Builder signature = JavaProtoBuf.JavaFieldSignature.newBuilder(); signature.setName(nameTable.getSimpleNameIndex(Name.guess(name))); signature.setType(type(type)); + if (isStaticInOuter) { + signature.setIsStaticInOuter(true); + } return signature.build(); } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/AnnotationDescriptorDeserializer.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/AnnotationDescriptorDeserializer.java index 30f83544824..9149fe7fdf0 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/AnnotationDescriptorDeserializer.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/AnnotationDescriptorDeserializer.java @@ -26,10 +26,7 @@ import org.jetbrains.jet.descriptors.serialization.JavaProtoBufUtil; import org.jetbrains.jet.descriptors.serialization.NameResolver; import org.jetbrains.jet.descriptors.serialization.ProtoBuf; import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationDeserializer; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.ClassOrNamespaceDescriptor; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; +import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; @@ -230,6 +227,12 @@ public class AnnotationDescriptorDeserializer implements AnnotationDeserializer } } } + else if (container instanceof ClassDescriptor && ((ClassDescriptor) container).getKind() == ClassKind.CLASS_OBJECT) { + // Backing fields of properties of a class object are generated in the outer class + if (JavaProtoBufUtil.isStaticFieldInOuter(proto)) { + return findVirtualFileByDescriptor((ClassOrNamespaceDescriptor) container.getContainingDeclaration()); + } + } return findVirtualFileByDescriptor(container); } diff --git a/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.kt b/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.kt new file mode 100644 index 00000000000..3de58cb7e6a --- /dev/null +++ b/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.kt @@ -0,0 +1,9 @@ +package test + +annotation class Anno + +class Class { + class object { + [Anno] var property: Int = 42 + } +} diff --git a/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.txt b/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.txt new file mode 100644 index 00000000000..f621366a247 --- /dev/null +++ b/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.txt @@ -0,0 +1,16 @@ +package test + +internal final annotation class Anno : jet.Annotation { + /*primary*/ public constructor Anno() +} + +internal final class Class { + /*primary*/ public constructor Class() + + internal class object { + /*primary*/ private constructor () + test.Anno() internal final var property: jet.Int + internal final fun (): jet.Int + internal final fun (/*0*/ : jet.Int): jet.Unit + } +} diff --git a/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.kt b/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.kt new file mode 100644 index 00000000000..467f446b84d --- /dev/null +++ b/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.kt @@ -0,0 +1,10 @@ +package test + +annotation class Anno + +class Class { + class object { + [Anno] val property: Int + get() = 42 + } +} diff --git a/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.txt b/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.txt new file mode 100644 index 00000000000..470a65baeb1 --- /dev/null +++ b/compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.txt @@ -0,0 +1,15 @@ +package test + +internal final annotation class Anno : jet.Annotation { + /*primary*/ public constructor Anno() +} + +internal final class Class { + /*primary*/ public constructor Class() + + internal class object { + /*primary*/ private constructor () + test.Anno() internal final val property: jet.Int + internal final fun (): jet.Int + } +} diff --git a/compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.kt b/compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.kt new file mode 100644 index 00000000000..fde1b44b405 --- /dev/null +++ b/compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.kt @@ -0,0 +1,9 @@ +package test + +annotation class Anno + +class Class { + Anno val x: Int by object { + fun get(thiz: Class, data: PropertyMetadata) = null!! + } +} diff --git a/compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.txt b/compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.txt new file mode 100644 index 00000000000..ca73fd23824 --- /dev/null +++ b/compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.txt @@ -0,0 +1,11 @@ +package test + +internal final annotation class Anno : jet.Annotation { + /*primary*/ public constructor Anno() +} + +internal final class Class { + /*primary*/ public constructor Class() + test.Anno() internal final val x: jet.Int + internal final fun (): jet.Int +} diff --git a/compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.kt b/compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.kt new file mode 100644 index 00000000000..a6c9524e83b --- /dev/null +++ b/compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.kt @@ -0,0 +1,7 @@ +package test + +annotation class Anno + +Anno val x: Int by object { + fun get(thiz: Any?, data: PropertyMetadata) = null!! +} diff --git a/compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.txt b/compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.txt new file mode 100644 index 00000000000..646a51789ea --- /dev/null +++ b/compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.txt @@ -0,0 +1,8 @@ +package test + +test.Anno() internal val x: jet.Int + internal fun (): jet.Int + +internal final annotation class Anno : jet.Annotation { + /*primary*/ public constructor Anno() +} diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java index 19ab79154eb..99469e8fba2 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java @@ -50,6 +50,21 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/annotations/classMembers"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("ClassObjectPropertyField.kt") + public void testClassObjectPropertyField() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.kt"); + } + + @TestMetadata("ClassObjectPropertyNoField.kt") + public void testClassObjectPropertyNoField() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.kt"); + } + + @TestMetadata("DelegatedProperty.kt") + public void testDelegatedProperty() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.kt"); + } + @TestMetadata("Function.kt") public void testFunction() throws Exception { doTestWithAccessors("compiler/testData/loadKotlin/annotations/classMembers/Function.kt"); @@ -131,6 +146,11 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/annotations/packageMembers"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("DelegatedProperty.kt") + public void testDelegatedProperty() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.kt"); + } + @TestMetadata("Function.kt") public void testFunction() throws Exception { doTestWithAccessors("compiler/testData/loadKotlin/annotations/packageMembers/Function.kt"); diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java index 8406792ebd1..0a4734679b0 100644 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java @@ -52,6 +52,21 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/annotations/classMembers"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("ClassObjectPropertyField.kt") + public void testClassObjectPropertyField() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyField.kt"); + } + + @TestMetadata("ClassObjectPropertyNoField.kt") + public void testClassObjectPropertyNoField() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/annotations/classMembers/ClassObjectPropertyNoField.kt"); + } + + @TestMetadata("DelegatedProperty.kt") + public void testDelegatedProperty() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/annotations/classMembers/DelegatedProperty.kt"); + } + @TestMetadata("Function.kt") public void testFunction() throws Exception { doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/annotations/classMembers/Function.kt"); @@ -133,6 +148,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/annotations/packageMembers"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("DelegatedProperty.kt") + public void testDelegatedProperty() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/annotations/packageMembers/DelegatedProperty.kt"); + } + @TestMetadata("Function.kt") public void testFunction() throws Exception { doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/annotations/packageMembers/Function.kt");