Positioning strategy used in "conflicting upper bounds" error messages
This commit is contained in:
@@ -184,8 +184,10 @@ public interface Errors {
|
|||||||
DiagnosticFactory1<JetTypeReference, JetType> FINAL_UPPER_BOUND = DiagnosticFactory1.create(WARNING);
|
DiagnosticFactory1<JetTypeReference, JetType> FINAL_UPPER_BOUND = DiagnosticFactory1.create(WARNING);
|
||||||
DiagnosticFactory1<JetTypeReference, JetType> FINAL_CLASS_OBJECT_UPPER_BOUND = DiagnosticFactory1.create(ERROR);
|
DiagnosticFactory1<JetTypeReference, JetType> FINAL_CLASS_OBJECT_UPPER_BOUND = DiagnosticFactory1.create(ERROR);
|
||||||
|
|
||||||
DiagnosticFactory1<PsiElement, TypeParameterDescriptor> CONFLICTING_UPPER_BOUNDS = DiagnosticFactory1.create(ERROR);
|
DiagnosticFactory1<PsiNameIdentifierOwner, TypeParameterDescriptor> CONFLICTING_UPPER_BOUNDS =
|
||||||
DiagnosticFactory1<PsiElement, TypeParameterDescriptor> CONFLICTING_CLASS_OBJECT_UPPER_BOUNDS = DiagnosticFactory1.create(ERROR);
|
DiagnosticFactory1.create(ERROR, NAME_IDENTIFIER);
|
||||||
|
DiagnosticFactory1<PsiNameIdentifierOwner, TypeParameterDescriptor> CONFLICTING_CLASS_OBJECT_UPPER_BOUNDS
|
||||||
|
= DiagnosticFactory1.create(ERROR, NAME_IDENTIFIER);
|
||||||
|
|
||||||
DiagnosticFactory2<JetSimpleNameExpression, JetTypeConstraint, JetTypeParameterListOwner> NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER =
|
DiagnosticFactory2<JetSimpleNameExpression, JetTypeConstraint, JetTypeParameterListOwner> NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER =
|
||||||
DiagnosticFactory2.create(ERROR);
|
DiagnosticFactory2.create(ERROR);
|
||||||
|
|||||||
@@ -702,18 +702,13 @@ public class DescriptorResolver {
|
|||||||
@NotNull TypeParameterDescriptor parameter,
|
@NotNull TypeParameterDescriptor parameter,
|
||||||
@NotNull JetTypeParameter typeParameter
|
@NotNull JetTypeParameter typeParameter
|
||||||
) {
|
) {
|
||||||
PsiElement nameIdentifier = typeParameter.getNameIdentifier();
|
|
||||||
if (KotlinBuiltIns.getInstance().isNothing(parameter.getUpperBoundsAsType())) {
|
if (KotlinBuiltIns.getInstance().isNothing(parameter.getUpperBoundsAsType())) {
|
||||||
if (nameIdentifier != null) {
|
trace.report(CONFLICTING_UPPER_BOUNDS.on(typeParameter, parameter));
|
||||||
trace.report(CONFLICTING_UPPER_BOUNDS.on(nameIdentifier, parameter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JetType classObjectType = parameter.getClassObjectType();
|
JetType classObjectType = parameter.getClassObjectType();
|
||||||
if (classObjectType != null && KotlinBuiltIns.getInstance().isNothing(classObjectType)) {
|
if (classObjectType != null && KotlinBuiltIns.getInstance().isNothing(classObjectType)) {
|
||||||
if (nameIdentifier != null) {
|
trace.report(CONFLICTING_CLASS_OBJECT_UPPER_BOUNDS.on(typeParameter, parameter));
|
||||||
trace.report(CONFLICTING_CLASS_OBJECT_UPPER_BOUNDS.on(nameIdentifier, parameter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user