Use original descriptor when working with errors in KotlinSignature
Otherwise enhanced version are treated differently
This commit is contained in:
+1
-1
@@ -132,6 +132,6 @@ public class TraceBasedExternalSignatureResolver implements ExternalSignatureRes
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reportSignatureErrors(@NotNull CallableMemberDescriptor descriptor, @NotNull List<String> signatureErrors) {
|
public void reportSignatureErrors(@NotNull CallableMemberDescriptor descriptor, @NotNull List<String> signatureErrors) {
|
||||||
trace.record(JavaBindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS, descriptor, signatureErrors);
|
trace.record(JavaBindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS, descriptor.getOriginal(), signatureErrors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ public class ExpectedLoadErrorsUtil {
|
|||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
List<String> errors = Arrays.asList(error.split("\\|"));
|
List<String> errors = Arrays.asList(error.split("\\|"));
|
||||||
|
|
||||||
map.put(descriptor, errors);
|
map.put(descriptor.getOriginal(), errors);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ public class ExpectedLoadErrorsUtil {
|
|||||||
Collection<DeclarationDescriptor> descriptors = bindingContext.getKeys(JavaBindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS);
|
Collection<DeclarationDescriptor> descriptors = bindingContext.getKeys(JavaBindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS);
|
||||||
for (DeclarationDescriptor descriptor : descriptors) {
|
for (DeclarationDescriptor descriptor : descriptors) {
|
||||||
List<String> errors = bindingContext.get(JavaBindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS, descriptor);
|
List<String> errors = bindingContext.get(JavaBindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS, descriptor);
|
||||||
result.put(descriptor, errors);
|
result.put(descriptor.getOriginal(), errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
+5
-3
@@ -33,9 +33,10 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
|
|||||||
@NotNull Visibility visibility,
|
@NotNull Visibility visibility,
|
||||||
boolean isVar,
|
boolean isVar,
|
||||||
@NotNull Name name,
|
@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
|
@Override
|
||||||
@@ -56,7 +57,8 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
|
|||||||
getVisibility(),
|
getVisibility(),
|
||||||
isVar(),
|
isVar(),
|
||||||
getName(),
|
getName(),
|
||||||
getSource()
|
getSource(),
|
||||||
|
getOriginal()
|
||||||
);
|
);
|
||||||
assert getGetter() == null : "Field must not have a getter: " + this;
|
assert getGetter() == null : "Field must not have a getter: " + this;
|
||||||
assert getSetter() == null : "Field must not have a setter: " + this;
|
assert getSetter() == null : "Field must not have a setter: " + this;
|
||||||
|
|||||||
+1
-1
@@ -104,7 +104,7 @@ public class LazyJavaClassMemberScope(
|
|||||||
|
|
||||||
val propertyDescriptor = JavaPropertyDescriptor(
|
val propertyDescriptor = JavaPropertyDescriptor(
|
||||||
getContainingDeclaration(), annotations, method.getVisibility(),
|
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
|
// default getter is necessary because there is no real field in annotation
|
||||||
|
|||||||
+1
-1
@@ -276,7 +276,7 @@ public abstract class LazyJavaMemberScope(
|
|||||||
val propertyName = field.getName()
|
val propertyName = field.getName()
|
||||||
|
|
||||||
return JavaPropertyDescriptor(containingDeclaration, annotations, visibility, isVar, propertyName,
|
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 {
|
private fun getPropertyType(field: JavaField, annotations: Annotations): JetType {
|
||||||
|
|||||||
Reference in New Issue
Block a user