Improve the highlight range for type_parameter_supertype_of_its_bound

Change-Id: I6184d09bac93a634a08441b3fcee8c4dcf816387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204361
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Brian Wilkerson 2021-06-21 15:35:15 +00:00
parent 497f1020a8
commit 430709cd1d
2 changed files with 5 additions and 5 deletions

View file

@ -4019,7 +4019,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
var element = parameter.declaredElement!;
errorReporter.reportErrorForNode(
CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
parameter,
parameter.name,
[element.displayName, element.bound],
);
break;

View file

@ -22,7 +22,7 @@ class TypeParameterSupertypeOfItsBoundTest extends PubPackageResolutionTest
class A<T extends T> {
}
''', [
error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 11),
error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 1),
]);
}
@ -34,7 +34,7 @@ class A<T extends T> {
}
}
''', [
error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 11),
error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 1),
]);
}
@ -43,8 +43,8 @@ class A<T extends T> {
class A<T1 extends T3, T2, T3 extends T1> {
}
''', [
error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 13),
error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 27, 13),
error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 2),
error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 27, 2),
]);
}
}