Merge remote branch 'origin/master'

This commit is contained in:
Andrey Breslav
2011-11-30 10:20:31 +03:00
3 changed files with 25 additions and 1 deletions
@@ -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();
}
}
}
@@ -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;
@@ -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);