mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 10:33:28 +00:00
skip directives during nnbd migration
Currently, the migration engine crashes when it visits the identifier in the following directive: import "dart:core" as one; This updates the migration engine to skip directives when looking for expressions and type annotations to be migrated. Change-Id: I079263b13e5f4c75fbfe22fa06993e7a5d4f9c16 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106660 Reviewed-by: Paul Berry <paulberry@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Dan Rubel <danrubel@google.com>
This commit is contained in:
parent
a75ded625e
commit
0e9d971f85
|
@ -483,6 +483,12 @@ class GraphBuilder extends GeneralizingAstVisitor<DecoratedType> {
|
|||
return expressionType;
|
||||
}
|
||||
|
||||
@override
|
||||
DecoratedType visitNamespaceDirective(NamespaceDirective node) {
|
||||
// skip directives
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
DecoratedType visitNode(AstNode node) {
|
||||
if (listener != null) {
|
||||
|
|
|
@ -1435,6 +1435,15 @@ main() {
|
|||
hard: true);
|
||||
}
|
||||
|
||||
test_skipDirectives() async {
|
||||
await analyze('''
|
||||
import "dart:core" as one;
|
||||
main() {}
|
||||
''');
|
||||
// No test expectations.
|
||||
// Just verifying that the test passes
|
||||
}
|
||||
|
||||
test_soft_edge_for_non_variable_reference() async {
|
||||
// Edges originating in things other than variable references should be
|
||||
// soft.
|
||||
|
|
Loading…
Reference in a new issue