Use original descriptor when working with errors in KotlinSignature

Otherwise enhanced version are treated differently
This commit is contained in:
Denis Zharkov
2015-06-17 18:27:01 +03:00
parent a551f21e9f
commit fd43799c6e
5 changed files with 10 additions and 8 deletions
@@ -33,9 +33,10 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
@NotNull Visibility visibility,
boolean isVar,
@NotNull Name name,
@NotNull SourceElement source
@NotNull SourceElement source,
@Nullable PropertyDescriptor original
) {
super(containingDeclaration, null, annotations, Modality.FINAL, visibility, isVar, name, Kind.DECLARATION, source);
super(containingDeclaration, original, annotations, Modality.FINAL, visibility, isVar, name, Kind.DECLARATION, source);
}
@Override
@@ -56,7 +57,8 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
getVisibility(),
isVar(),
getName(),
getSource()
getSource(),
getOriginal()
);
assert getGetter() == null : "Field must not have a getter: " + this;
assert getSetter() == null : "Field must not have a setter: " + this;
@@ -104,7 +104,7 @@ public class LazyJavaClassMemberScope(
val propertyDescriptor = JavaPropertyDescriptor(
getContainingDeclaration(), annotations, method.getVisibility(),
/* isVar = */ false, method.getName(), c.sourceElementFactory.source(method)
/* isVar = */ false, method.getName(), c.sourceElementFactory.source(method), /* original */ null
)
// default getter is necessary because there is no real field in annotation
@@ -276,7 +276,7 @@ public abstract class LazyJavaMemberScope(
val propertyName = field.getName()
return JavaPropertyDescriptor(containingDeclaration, annotations, visibility, isVar, propertyName,
c.sourceElementFactory.source(field))
c.sourceElementFactory.source(field), /* original = */ null)
}
private fun getPropertyType(field: JavaField, annotations: Annotations): JetType {