mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
[kernel] Get location less in verifier
Change-Id: I644f46819b2c4524f57aa3a37f4e2b754b6f951d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322641 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
ba2642c2a6
commit
fc79ba71c6
1 changed files with 5 additions and 7 deletions
|
@ -1351,7 +1351,7 @@ class VerifyingVisitor extends RecursiveResultVisitor<void> {
|
|||
assert(treeNodeStack.isNotEmpty);
|
||||
for (int i = treeNodeStack.length - 1; i >= 0; --i) {
|
||||
TreeNode node = treeNodeStack[i];
|
||||
if (withLocation && !_hasLocation(node)) continue;
|
||||
if (withLocation && !_hasLocation(_getLocation(node), node)) continue;
|
||||
return node;
|
||||
}
|
||||
return null;
|
||||
|
@ -1363,8 +1363,8 @@ class VerifyingVisitor extends RecursiveResultVisitor<void> {
|
|||
|
||||
for (int i = treeNodeStack.length - 1; i >= 0; --i) {
|
||||
TreeNode node = treeNodeStack[i];
|
||||
if (withLocation && !_hasLocation(node)) continue;
|
||||
Location? location = _getLocation(node);
|
||||
if (withLocation && !_hasLocation(location, node)) continue;
|
||||
if (location != null && location.file == currentLibrary!.fileUri) {
|
||||
return node;
|
||||
}
|
||||
|
@ -1390,8 +1390,7 @@ class VerifyingVisitor extends RecursiveResultVisitor<void> {
|
|||
return null;
|
||||
}
|
||||
|
||||
bool _hasLocation(TreeNode node) {
|
||||
Location? location = _getLocation(node);
|
||||
bool _hasLocation(Location? location, TreeNode node) {
|
||||
return location != null && node.fileOffset != TreeNode.noOffset;
|
||||
}
|
||||
|
||||
|
@ -1512,10 +1511,9 @@ class VerifyingVisitor extends RecursiveResultVisitor<void> {
|
|||
|
||||
@override
|
||||
void defaultDartType(DartType node) {
|
||||
final TreeNode? localContext = this.localContext;
|
||||
final TreeNode? remoteContext = this.remoteContext;
|
||||
|
||||
if (!KnownTypes.isKnown(node)) {
|
||||
final TreeNode? localContext = this.localContext;
|
||||
final TreeNode? remoteContext = this.remoteContext;
|
||||
problem(localContext, "Unexpected appearance of the unknown type.",
|
||||
origin: remoteContext);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue