diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/wrapper/PropertyPsiData.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/wrapper/PropertyPsiData.java index 12de73162c0..8a50ced17e2 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/wrapper/PropertyPsiData.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/wrapper/PropertyPsiData.java @@ -199,10 +199,10 @@ public final class PropertyPsiData { if (getter != null) { return getter.getMember().isFinal(); } - if (setter != null) { return setter.getMember().isFinal(); } - return false; + assert field != null : "Property with no getter and no setter should at least have a backing field"; + return field.getMember().isFinal(); } } diff --git a/compiler/frontend/builtins/jet/Array.kotlin_class b/compiler/frontend/builtins/jet/Array.kotlin_class index 81ac69f50dd..647cceb3adf 100644 Binary files a/compiler/frontend/builtins/jet/Array.kotlin_class and b/compiler/frontend/builtins/jet/Array.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/BooleanArray.kotlin_class b/compiler/frontend/builtins/jet/BooleanArray.kotlin_class index dfc8a9ef456..7771e754816 100644 Binary files a/compiler/frontend/builtins/jet/BooleanArray.kotlin_class and b/compiler/frontend/builtins/jet/BooleanArray.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/ByteArray.kotlin_class b/compiler/frontend/builtins/jet/ByteArray.kotlin_class index 9061e51d1c1..6de58db1613 100644 Binary files a/compiler/frontend/builtins/jet/ByteArray.kotlin_class and b/compiler/frontend/builtins/jet/ByteArray.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/ByteProgression.kotlin_class b/compiler/frontend/builtins/jet/ByteProgression.kotlin_class index ef246143190..7dd8b10c409 100644 Binary files a/compiler/frontend/builtins/jet/ByteProgression.kotlin_class and b/compiler/frontend/builtins/jet/ByteProgression.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/ByteRange.kotlin_class b/compiler/frontend/builtins/jet/ByteRange.kotlin_class index a3b523bb4d0..7bb24090129 100644 Binary files a/compiler/frontend/builtins/jet/ByteRange.kotlin_class and b/compiler/frontend/builtins/jet/ByteRange.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/ByteRange.object.kotlin_class b/compiler/frontend/builtins/jet/ByteRange.object.kotlin_class index 01ad0fbf162..222f9338e89 100644 --- a/compiler/frontend/builtins/jet/ByteRange.object.kotlin_class +++ b/compiler/frontend/builtins/jet/ByteRange.object.kotlin_class @@ -1,4 +1,4 @@ † H2 R Â0B -Z Æ0IB +Z Æ 0IB  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/CharArray.kotlin_class b/compiler/frontend/builtins/jet/CharArray.kotlin_class index 39b481e385d..b5c7e1fe3a1 100644 Binary files a/compiler/frontend/builtins/jet/CharArray.kotlin_class and b/compiler/frontend/builtins/jet/CharArray.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/CharProgression.kotlin_class b/compiler/frontend/builtins/jet/CharProgression.kotlin_class index 2a8d3e3e540..8d6d7be7520 100644 Binary files a/compiler/frontend/builtins/jet/CharProgression.kotlin_class and b/compiler/frontend/builtins/jet/CharProgression.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/CharRange.kotlin_class b/compiler/frontend/builtins/jet/CharRange.kotlin_class index e0da727f77c..cfc776a0da7 100644 Binary files a/compiler/frontend/builtins/jet/CharRange.kotlin_class and b/compiler/frontend/builtins/jet/CharRange.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/CharRange.object.kotlin_class b/compiler/frontend/builtins/jet/CharRange.object.kotlin_class index 44e85b154e7..6fe17e41a23 100644 --- a/compiler/frontend/builtins/jet/CharRange.object.kotlin_class +++ b/compiler/frontend/builtins/jet/CharRange.object.kotlin_class @@ -1,4 +1,4 @@ † N2 R Â0B -"Z Æ0IB +"Z Æ 0IB  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/CharSequence.kotlin_class b/compiler/frontend/builtins/jet/CharSequence.kotlin_class index 4186c13c878..582048817fe 100644 Binary files a/compiler/frontend/builtins/jet/CharSequence.kotlin_class and b/compiler/frontend/builtins/jet/CharSequence.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/DoubleArray.kotlin_class b/compiler/frontend/builtins/jet/DoubleArray.kotlin_class index a67fe299bf4..37135c22766 100644 Binary files a/compiler/frontend/builtins/jet/DoubleArray.kotlin_class and b/compiler/frontend/builtins/jet/DoubleArray.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/DoubleProgression.kotlin_class b/compiler/frontend/builtins/jet/DoubleProgression.kotlin_class index 17b77e93e78..923c15dad8c 100644 Binary files a/compiler/frontend/builtins/jet/DoubleProgression.kotlin_class and b/compiler/frontend/builtins/jet/DoubleProgression.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/DoubleRange.kotlin_class b/compiler/frontend/builtins/jet/DoubleRange.kotlin_class index 15d1f064a14..54dfef94aea 100644 Binary files a/compiler/frontend/builtins/jet/DoubleRange.kotlin_class and b/compiler/frontend/builtins/jet/DoubleRange.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/DoubleRange.object.kotlin_class b/compiler/frontend/builtins/jet/DoubleRange.object.kotlin_class index 604edababd5..31d3aeed766 100644 --- a/compiler/frontend/builtins/jet/DoubleRange.object.kotlin_class +++ b/compiler/frontend/builtins/jet/DoubleRange.object.kotlin_class @@ -1,4 +1,4 @@ † a2 R Â0B -*Z Æ0IB +*Z Æ 0IB  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/FloatArray.kotlin_class b/compiler/frontend/builtins/jet/FloatArray.kotlin_class index 3a71c733460..41221e29c76 100644 Binary files a/compiler/frontend/builtins/jet/FloatArray.kotlin_class and b/compiler/frontend/builtins/jet/FloatArray.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/FloatProgression.kotlin_class b/compiler/frontend/builtins/jet/FloatProgression.kotlin_class index 12d56179184..c1990486a61 100644 Binary files a/compiler/frontend/builtins/jet/FloatProgression.kotlin_class and b/compiler/frontend/builtins/jet/FloatProgression.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/FloatRange.kotlin_class b/compiler/frontend/builtins/jet/FloatRange.kotlin_class index 482a7c5112c..ea313686031 100644 Binary files a/compiler/frontend/builtins/jet/FloatRange.kotlin_class and b/compiler/frontend/builtins/jet/FloatRange.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/FloatRange.object.kotlin_class b/compiler/frontend/builtins/jet/FloatRange.object.kotlin_class index 0bd839ff6c6..bbc3ccecd98 100644 --- a/compiler/frontend/builtins/jet/FloatRange.object.kotlin_class +++ b/compiler/frontend/builtins/jet/FloatRange.object.kotlin_class @@ -1,4 +1,4 @@ † ®2 R Â0B -/Z Æ0IB +/Z Æ 0IB  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/IntArray.kotlin_class b/compiler/frontend/builtins/jet/IntArray.kotlin_class index f1d6018a1aa..3418b23de14 100644 Binary files a/compiler/frontend/builtins/jet/IntArray.kotlin_class and b/compiler/frontend/builtins/jet/IntArray.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/IntProgression.kotlin_class b/compiler/frontend/builtins/jet/IntProgression.kotlin_class index 02d9b7719e1..197918f729b 100644 Binary files a/compiler/frontend/builtins/jet/IntProgression.kotlin_class and b/compiler/frontend/builtins/jet/IntProgression.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/IntRange.kotlin_class b/compiler/frontend/builtins/jet/IntRange.kotlin_class index e818683b98b..b8388da00b0 100644 Binary files a/compiler/frontend/builtins/jet/IntRange.kotlin_class and b/compiler/frontend/builtins/jet/IntRange.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/IntRange.object.kotlin_class b/compiler/frontend/builtins/jet/IntRange.object.kotlin_class index c422d0b6ef9..643cbc2d971 100644 --- a/compiler/frontend/builtins/jet/IntRange.object.kotlin_class +++ b/compiler/frontend/builtins/jet/IntRange.object.kotlin_class @@ -1,4 +1,4 @@ † Î2 R Â0B -3Z Æ0IB +3Z Æ 0IB  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/LongArray.kotlin_class b/compiler/frontend/builtins/jet/LongArray.kotlin_class index 4ddc7e141ed..9f12c54b0e8 100644 Binary files a/compiler/frontend/builtins/jet/LongArray.kotlin_class and b/compiler/frontend/builtins/jet/LongArray.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/LongProgression.kotlin_class b/compiler/frontend/builtins/jet/LongProgression.kotlin_class index caa9ff3a857..289cef019e3 100644 Binary files a/compiler/frontend/builtins/jet/LongProgression.kotlin_class and b/compiler/frontend/builtins/jet/LongProgression.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/LongRange.kotlin_class b/compiler/frontend/builtins/jet/LongRange.kotlin_class index acb0491bb42..d6ff235851e 100644 Binary files a/compiler/frontend/builtins/jet/LongRange.kotlin_class and b/compiler/frontend/builtins/jet/LongRange.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/LongRange.object.kotlin_class b/compiler/frontend/builtins/jet/LongRange.object.kotlin_class index feab5fccf57..7bf7f941072 100644 --- a/compiler/frontend/builtins/jet/LongRange.object.kotlin_class +++ b/compiler/frontend/builtins/jet/LongRange.object.kotlin_class @@ -1,4 +1,4 @@ † ¥2 R Â0B -fZ Æ0IB +fZ Æ 0IB  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/Progression.kotlin_class b/compiler/frontend/builtins/jet/Progression.kotlin_class index 1b5329373ab..88dd2abcc34 100644 Binary files a/compiler/frontend/builtins/jet/Progression.kotlin_class and b/compiler/frontend/builtins/jet/Progression.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/PropertyMetadata.kotlin_class b/compiler/frontend/builtins/jet/PropertyMetadata.kotlin_class index f29fe2e81a5..47294ffc9ea 100644 --- a/compiler/frontend/builtins/jet/PropertyMetadata.kotlin_class +++ b/compiler/frontend/builtins/jet/PropertyMetadata.kotlin_class @@ -1,3 +1,3 @@ f É2 -Z æ0cB +Z æ 0cB # \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/PropertyMetadataImpl.kotlin_class b/compiler/frontend/builtins/jet/PropertyMetadataImpl.kotlin_class index 27ec7e0024f..fb65a697b9d 100644 Binary files a/compiler/frontend/builtins/jet/PropertyMetadataImpl.kotlin_class and b/compiler/frontend/builtins/jet/PropertyMetadataImpl.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Range.kotlin_class b/compiler/frontend/builtins/jet/Range.kotlin_class index 35221e18fd8..98001887088 100644 Binary files a/compiler/frontend/builtins/jet/Range.kotlin_class and b/compiler/frontend/builtins/jet/Range.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/ShortArray.kotlin_class b/compiler/frontend/builtins/jet/ShortArray.kotlin_class index a7c5cd23081..4f7b12c5482 100644 Binary files a/compiler/frontend/builtins/jet/ShortArray.kotlin_class and b/compiler/frontend/builtins/jet/ShortArray.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/ShortProgression.kotlin_class b/compiler/frontend/builtins/jet/ShortProgression.kotlin_class index 1b206b8e955..7cfec3a21bc 100644 Binary files a/compiler/frontend/builtins/jet/ShortProgression.kotlin_class and b/compiler/frontend/builtins/jet/ShortProgression.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/ShortRange.kotlin_class b/compiler/frontend/builtins/jet/ShortRange.kotlin_class index 1d919787b56..a21d245816e 100644 Binary files a/compiler/frontend/builtins/jet/ShortRange.kotlin_class and b/compiler/frontend/builtins/jet/ShortRange.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/ShortRange.object.kotlin_class b/compiler/frontend/builtins/jet/ShortRange.object.kotlin_class index c8464866ee7..88df0526c84 100644 --- a/compiler/frontend/builtins/jet/ShortRange.object.kotlin_class +++ b/compiler/frontend/builtins/jet/ShortRange.object.kotlin_class @@ -1,4 +1,4 @@ † Ï2 R Â0B -xZ Æ0IB +xZ Æ 0IB  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/String.kotlin_class b/compiler/frontend/builtins/jet/String.kotlin_class index 7fd163631aa..dc5712a1057 100644 Binary files a/compiler/frontend/builtins/jet/String.kotlin_class and b/compiler/frontend/builtins/jet/String.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Unit.object.kotlin_class b/compiler/frontend/builtins/jet/Unit.object.kotlin_class index 3a9b86d6fb1..e82ca791691 100644 --- a/compiler/frontend/builtins/jet/Unit.object.kotlin_class +++ b/compiler/frontend/builtins/jet/Unit.object.kotlin_class @@ -1,4 +1,4 @@ † ×2 R Â0B -{Z Æ0ØB +{Z Æ 0ØB  \ No newline at end of file diff --git a/compiler/frontend/serialization/src/descriptors.proto b/compiler/frontend/serialization/src/descriptors.proto index b26816b4bdd..fa4bba55af6 100644 --- a/compiler/frontend/serialization/src/descriptors.proto +++ b/compiler/frontend/serialization/src/descriptors.proto @@ -144,11 +144,12 @@ message Callable { } enum CallableKind { - // 2 bits + // 3 bits FUN = 0; VAL = 1; VAR = 2; CONSTRUCTOR = 3; + OBJECT_PROPERTY = 4; } /* diff --git a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ClassId.java b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ClassId.java index 45c5adc8c59..e46fdc27186 100644 --- a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ClassId.java +++ b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ClassId.java @@ -1,7 +1,5 @@ package org.jetbrains.jet.descriptors.serialization; -import com.intellij.util.Function; -import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.ClassOrNamespaceDescriptor; import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; @@ -20,23 +18,23 @@ public final class ClassId { public static ClassId fromFqNameAndContainingDeclaration( @NotNull FqName fqName, @NotNull ClassOrNamespaceDescriptor containingDeclaration + ) { + return fromFqNameAndContainingDeclaration(fqName.toUnsafe(), containingDeclaration); + } + + @NotNull + public static ClassId fromFqNameAndContainingDeclaration( + @NotNull FqNameUnsafe fqName, + @NotNull ClassOrNamespaceDescriptor containingDeclaration ) { NamespaceDescriptor containingNamespace = DescriptorUtils.getParentOfType(containingDeclaration, NamespaceDescriptor.class, false); assert containingNamespace != null; List fullNameSegments = fqName.pathSegments(); FqName namespaceFqName = DescriptorUtils.getFQName(containingNamespace).toSafe(); List namespaceNameSegments = namespaceFqName.pathSegments(); - for (int i = 0; i < namespaceNameSegments.size(); ++i) { - assert fullNameSegments.get(i).equals(namespaceNameSegments.get(i)); - } + assert fullNameSegments.subList(0, namespaceNameSegments.size()).equals(namespaceNameSegments); List relativeNameSegments = fullNameSegments.subList(namespaceNameSegments.size(), fullNameSegments.size()); - FqName relativeFqName = FqName.fromSegments(ContainerUtil.map2List(relativeNameSegments, new Function() { - @Override - public String fun(Name name) { - return name.asString(); - } - })); - return new ClassId(namespaceFqName, relativeFqName.toUnsafe()); + return new ClassId(namespaceFqName, FqNameUnsafe.fromSegments(relativeNameSegments)); } public ClassId(@NotNull FqName packageFqName, @NotNull FqNameUnsafe relativeClassName) { diff --git a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorDeserializer.java b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorDeserializer.java index f9ed665d7a8..7f980a492cb 100644 --- a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorDeserializer.java +++ b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorDeserializer.java @@ -24,7 +24,10 @@ import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.descriptors.impl.*; import org.jetbrains.jet.lang.resolve.DescriptorResolver; +import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.lazy.storage.StorageManager; +import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe; +import org.jetbrains.jet.lang.resolve.name.Name; import org.jetbrains.jet.lang.types.Variance; import java.util.ArrayList; @@ -121,6 +124,7 @@ public class DescriptorDeserializer { return loadFunction(proto); case VAL: case VAR: + case OBJECT_PROPERTY: return loadProperty(proto); case CONSTRUCTOR: return loadConstructor(proto); @@ -130,16 +134,8 @@ public class DescriptorDeserializer { @NotNull private PropertyDescriptor loadProperty(@NotNull Callable proto) { - int flags = proto.getFlags(); - PropertyDescriptorImpl property = new PropertyDescriptorImpl( - containingDeclaration, - getAnnotations(proto), - modality(Flags.MODALITY.get(flags)), - visibility(Flags.VISIBILITY.get(flags)), - Flags.CALLABLE_KIND.get(flags) == Callable.CallableKind.VAR, - nameResolver.getName(proto.getName()), - memberKind(Flags.MEMBER_KIND.get(flags)) - ); + PropertyDescriptorImpl property = createPropertyDescriptor(proto); + List typeParameters = new ArrayList(proto.getTypeParameterCount()); DescriptorDeserializer local = createChildDeserializer(property, proto.getTypeParameterList(), typeParameters); property.setType( @@ -152,7 +148,7 @@ public class DescriptorDeserializer { PropertyGetterDescriptorImpl getter = null; PropertySetterDescriptorImpl setter = null; - if (Flags.HAS_GETTER.get(flags)) { + if (Flags.HAS_GETTER.get(proto.getFlags())) { int getterFlags = proto.getGetterFlags(); boolean isNotDefault = proto.hasGetterFlags() && Flags.IS_NOT_DEFAULT.get(getterFlags); if (isNotDefault) { @@ -168,7 +164,7 @@ public class DescriptorDeserializer { getter.initialize(property.getReturnType()); } - if (Flags.HAS_SETTER.get(flags)) { + if (Flags.HAS_SETTER.get(proto.getFlags())) { int setterFlags = proto.getSetterFlags(); boolean isNotDefault = proto.hasSetterFlags() && Flags.IS_NOT_DEFAULT.get(setterFlags); if (isNotDefault) { @@ -192,6 +188,36 @@ public class DescriptorDeserializer { return property; } + @NotNull + private PropertyDescriptorImpl createPropertyDescriptor(@NotNull Callable proto) { + int flags = proto.getFlags(); + Name name = nameResolver.getName(proto.getName()); + List annotations = getAnnotations(proto); + Visibility visibility = visibility(Flags.VISIBILITY.get(flags)); + Callable.CallableKind callableKind = Flags.CALLABLE_KIND.get(flags); + + if (callableKind == Callable.CallableKind.OBJECT_PROPERTY) { + assert containingDeclaration instanceof ClassOrNamespaceDescriptor + : "Properties for objects can only exist in class or namespace: " + name; + FqNameUnsafe fqName = DescriptorUtils.getFQName(containingDeclaration).child(name); + ClassId objectId = ClassId.fromFqNameAndContainingDeclaration(fqName, (ClassOrNamespaceDescriptor) containingDeclaration); + ClassDescriptor objectClass = typeDeserializer.getDescriptorFinder().findClass(objectId); + assert objectClass != null : "Object for property not found: " + name; + + return new PropertyDescriptorForObjectImpl(containingDeclaration, annotations, visibility, name, objectClass); + } + + return new PropertyDescriptorImpl( + containingDeclaration, + annotations, + modality(Flags.MODALITY.get(flags)), + visibility, + callableKind == Callable.CallableKind.VAR, + name, + memberKind(Flags.MEMBER_KIND.get(flags)) + ); + } + @NotNull private CallableMemberDescriptor loadFunction(@NotNull Callable proto) { int flags = proto.getFlags(); diff --git a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorSerializer.java b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorSerializer.java index aa9a6dfd318..ae4611f76cc 100644 --- a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorSerializer.java +++ b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorSerializer.java @@ -256,7 +256,10 @@ public class DescriptorSerializer { } private static ProtoBuf.Callable.CallableKind callableKind(CallableMemberDescriptor descriptor) { - if (descriptor instanceof PropertyDescriptor) { + if (descriptor instanceof VariableDescriptorForObject) { + return ProtoBuf.Callable.CallableKind.OBJECT_PROPERTY; + } + else if (descriptor instanceof PropertyDescriptor) { PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor; return propertyDescriptor.isVar() ? ProtoBuf.Callable.CallableKind.VAR : ProtoBuf.Callable.CallableKind.VAL; } diff --git a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java index b5dcc833d69..ea21b87889a 100644 --- a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java +++ b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java @@ -5380,12 +5380,14 @@ public final class ProtoBuf { VAL(1, 1), VAR(2, 2), CONSTRUCTOR(3, 3), + OBJECT_PROPERTY(4, 4), ; public static final int FUN_VALUE = 0; public static final int VAL_VALUE = 1; public static final int VAR_VALUE = 2; public static final int CONSTRUCTOR_VALUE = 3; + public static final int OBJECT_PROPERTY_VALUE = 4; public final int getNumber() { return value; } @@ -5396,6 +5398,7 @@ public final class ProtoBuf { case 1: return VAL; case 2: return VAR; case 3: return CONSTRUCTOR; + case 4: return OBJECT_PROPERTY; default: return null; } } diff --git a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/TypeDeserializer.java b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/TypeDeserializer.java index f3b11c03e31..2c01ff879c2 100644 --- a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/TypeDeserializer.java +++ b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/TypeDeserializer.java @@ -100,6 +100,10 @@ public class TypeDeserializer { }, STRONG); } + /* package */ DescriptorFinder getDescriptorFinder() { + return descriptorFinder; + } + @Nullable public JetType typeOrNull(@Nullable ProtoBuf.Type proto) { if (proto == null) { diff --git a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedMemberScope.java b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedMemberScope.java index 2b312aa19a8..4e33a9101f6 100644 --- a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedMemberScope.java +++ b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedMemberScope.java @@ -24,7 +24,9 @@ import org.jetbrains.jet.descriptors.serialization.DescriptorDeserializer; import org.jetbrains.jet.descriptors.serialization.Flags; import org.jetbrains.jet.descriptors.serialization.ProtoBuf; import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.resolve.lazy.storage.*; +import org.jetbrains.jet.lang.resolve.lazy.storage.MemoizedFunctionToNotNull; +import org.jetbrains.jet.lang.resolve.lazy.storage.NotNullLazyValue; +import org.jetbrains.jet.lang.resolve.lazy.storage.StorageManager; import org.jetbrains.jet.lang.resolve.name.LabelName; import org.jetbrains.jet.lang.resolve.name.Name; import org.jetbrains.jet.lang.resolve.scopes.JetScope; @@ -44,7 +46,9 @@ public abstract class DeserializedMemberScope implements JetScope { private static final Filter PROPERTY = new Filter() { @Override public boolean accept(ProtoBuf.Callable.CallableKind value) { - return value == ProtoBuf.Callable.CallableKind.VAL || value == ProtoBuf.Callable.CallableKind.VAR; + return value == ProtoBuf.Callable.CallableKind.VAL || + value == ProtoBuf.Callable.CallableKind.VAR || + value == ProtoBuf.Callable.CallableKind.OBJECT_PROPERTY; } }; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/name/FqNameUnsafe.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/name/FqNameUnsafe.java index 4f5a21a2408..cbb2c4441a4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/name/FqNameUnsafe.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/name/FqNameUnsafe.java @@ -17,6 +17,7 @@ package org.jetbrains.jet.lang.resolve.name; import com.google.common.collect.Lists; +import com.intellij.openapi.util.text.StringUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -250,6 +251,12 @@ public final class FqNameUnsafe extends FqNameBase { return shortName().equals(segment); } + @NotNull + public static FqNameUnsafe fromSegments(@NotNull List names) { + String fqName = StringUtil.join(names, "."); + return new FqNameUnsafe(fqName); + } + @NotNull