Remove TypeParameterSerializationContext.location.

Its only use was in formatting an internal error message that
generally only fires in unit tests if we have significant bugs in
summary logic.  Eliminating it doesn't really make the error any more
difficult to debug, since it is easy enough to stop the unit test in
the debugger and examine the data structures manually.

Addresses code review comment
https://dart-review.googlesource.com/c/sdk/+/79145/1/pkg/analyzer/lib/src/dart/element/element.dart#7737

Change-Id: I17f18e1e4abfac4c5dd9067706fabc9bc4de7cff
Reviewed-on: https://dart-review.googlesource.com/c/79282
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Paul Berry 2018-10-11 17:49:30 +00:00 committed by commit-bot@chromium.org
parent 244e6c7ffc
commit 49b121f20d
2 changed files with 1 additions and 9 deletions

View file

@ -7770,10 +7770,6 @@ abstract class TypeParameterizedElementMixin
/// Interface used by linker serialization methods to convert type parameter
/// references into De Bruijn indices.
abstract class TypeParameterSerializationContext {
/// Return an object representing the location of this element in the element
/// model. The object can be used to locate this element at a later time.
ElementLocation get location;
/// Return the given [typeParameter]'s de Bruijn index in this context, or
/// `null` if it's not in scope.
///

View file

@ -206,7 +206,7 @@ EntityRefBuilder _createLinkedType(
result.paramReference = deBruijnIndex;
} else {
throw new StateError('The type parameter $type (in ${element?.location}) '
'is out of scope on ${typeParameterContext?.location}.');
'is out of scope.');
}
return result;
} else if (type is FunctionType) {
@ -3393,10 +3393,6 @@ class InlineFunctionTypeParameterContext
InlineFunctionTypeParameterContext(
this._functionTypeElement, this._usageContext);
@override
ElementLocation get location =>
throw new UnimplementedError('TODO(paulberry)');
@override
int computeDeBruijnIndex(TypeParameterElement typeParameter,
{int offset: 0}) {