diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.java index defab1eca28..e3614e3f356 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.java @@ -46,6 +46,12 @@ public abstract class DeclarationDescriptorImpl extends AnnotatedImpl implements @Override public String toString() { - return DescriptorRenderer.TEXT.render(this) + "[" + getClass().getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this)) + "]"; + try { + return DescriptorRenderer.TEXT.render(this) + "[" + getClass().getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this)) + "]"; + } catch (Throwable e) { + // DescriptionRenderer may throw if this is not yet completely initialized + // It is very inconvenient while debugging + return super.toString(); + } } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.java b/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.java index 361eb70fbb4..27768fa2b22 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.java @@ -118,6 +118,16 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab return getOutType(); } + @Override + public JetType getInType() { + return super.getInType(); + } + + @Override + @NotNull + public JetType getOutType() { + return super.getOutType(); + } public boolean isVar() { return isVar; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.java index 37de89a17ca..ed1febfd63a 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.java @@ -299,11 +299,19 @@ public class WritableScopeImpl extends WritableScopeWithImports { @Override public void addPropertyDescriptorByFieldName(@NotNull String fieldName, @NotNull PropertyDescriptor propertyDescriptor) { + if (!fieldName.startsWith("$")) { + throw new IllegalStateException(); + } + getPropertyDescriptorsByFieldNames().put(fieldName, propertyDescriptor); } @Override public PropertyDescriptor getPropertyByFieldReference(@NotNull String fieldName) { + if (!fieldName.startsWith("$")) { + throw new IllegalStateException(); + } + PropertyDescriptor descriptor = getPropertyDescriptorsByFieldNames().get(fieldName); if (descriptor != null) return descriptor; return super.getPropertyByFieldReference(fieldName);