This should address ~21 exceptions whose stack trace includes the line:
new DecoratedType.<anonymous closure> (package:nnbd_migration/src/decorated_type.dart:64:16)
Change-Id: Ic7ce9913c74ff468f8099e3b9f10a7a81eb00721
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Part-of support needed to be added.
Should address ~12 exceptions whose stack trace contains the line:
AnnotationTracker.visitCompilationUnit.<anonymous closure> (package:nnbd_migration/src/utilities/annotation_tracker.dart:39:16)
Change-Id: Ib25d6dc123ac6134b6b5d25081ad5cebe02fd951
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116441
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
This should address ~13 exceptions whose stack trace includes the line:
_AssignmentChecker._checkAssignment_recursion (package:nnbd_migration/src/edge_builder.dart:2089:7)
Change-Id: I74e78885c996b637d73f80ca2dabba0226fa1fff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116366
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This should address ~54 exceptions having this line in the stack trace:
Variables._createDecoratedElementType (package:nnbd_migration/src/variables.dart:241:7)
Note: this change exposed issue #38257, so it includes a workaround for it.
Change-Id: Id533c070a02d310661a05035679d9476ad2ab240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This should address ~37 exceptions whose stack trace includes the line:
EdgeBuilder.visitAssignmentExpression (package:nnbd_migration/src/edge_builder.dart:274:7)
Still not addressed: compound assignments using `??=`.
Change-Id: Iae97fcc4979c2a98c1dbb7ad57f62ebbfc4bb4b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
When the variable on the LHS of an assignment expression also appears
in its RHS, we want the RHS to contribute to generation of hard edges,
because the RHS is evaluated prior to the assignment. To achieve this
we need to remove the LHS variable from post-dominator scopes after
visiting the RHS.
Change-Id: Ifef9d69356e78e43f77ef456101b335ba3238312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116059
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This should address ~26 exceptions whose stack trace contains the line:
Variables._createDecoratedElementType (package:nnbd_migration/src/variables.dart:230:7)
Change-Id: I69fdf75aaa1e2a9bdbaef3b49c7928812566b131
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116083
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Should address ~48 exceptions whose stack trace includes the line:
Variables._createDecoratedElementType (package:nnbd_migration/src/variables.dart:230:7)
Change-Id: I13b89f347fc91fcca23392cf14dfd6c2876704f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116042
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This should address ~91 exceptions with this line in the stacktrace:
_AssignmentChecker._checkAssignment_recursion (package:nnbd_migration/src/edge_builder.dart:2031:7)
Change-Id: Id837ffb3eea207dd1f63010482a69397a8dff9ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115768
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This should address ~25 exceptions whose stack trace includes the line:
EdgeBuilder.visitMethodDeclaration (package:nnbd_migration/src/edge_builder.dart:843:7)
Change-Id: I0076592f43f18c68f499fc9a80347a73033f8919
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115802
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Fixes ~22 exceptions with a stacktrace containing the line:
DecoratedClassHierarchy.getDecoratedSupertype (package:nnbd_migration/src/decorated_class_hierarchy.dart:59:10)
Change-Id: I59bfcf19044f2bd985ec9bd4b33f307f9ab5bb24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Should address ~100 exceptions whose stack trace contains a line like this:
EdgeBuilder._checkNonObjectMember (package:nnbd_migration/src/edge_builder.dart:1293:12)
Change-Id: I48317502743c9f320fb6fa57ee4420030e309099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115062
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Should take care of ~152 exceptions having this line in their stacktrace:
AlreadyMigratedCodeDecorator.decorate (package:nnbd_migration/src/already_migrated_code_decorator.dart:40:9)
Change-Id: I5a97470431b36b2c0ef88c15281b1eb51156b05f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114758
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Should address ~758 exceptions whose stacktrace includes the line:
new DecoratedType.<anonymous closure> (package:nnbd_migration/src/decorated_type.dart:83:52)
Change-Id: I0c7e64ee54af204bed40f28891274f03d85fdf7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114746
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This should address ~267 exceptions whose stacktrace contains the line:
EdgeBuilder.getOrComputeElementType (package:nnbd_migration/src/edge_builder.dart:197:16)
Change-Id: If377190e0bdabe85f541af50cb5f896fde5481ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114741
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Should address 164 migration tool exceptions with this line in their
stacktrace:
DecoratedType._substitute (package:nnbd_migration/src/decorated_type.dart:406:5)
Change-Id: I03ff6a27f94e02f914ca88ae1371affcfb63c101
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114620
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Introduce a notion of a "node matcher" which abstacts knowledge of how
to match certain kinds of nullability nodes. This significantly
simplifies the tests of substitution nodes; instead of digging through
the graph to find the substitution node, asserting that it is a
substitution node, and then asserting that it has the right form, we
can simply use the existing `assertEdge` method to assert that an edge
exists with the appropriate kind of substitution node as either its
source or destination.
Change-Id: I1a483f18669fd0cf8075deb60e61a1930a40c4f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114630
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Should address 191 migration tool exceptions with this line in their
stacktrace:
EdgeBuilder.visitMethodInvocation (package:nnbd_migration/src/edge_builder.dart:849:7)
Change-Id: I0e29331a11c2078fea353f7511bb8f77765897d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114582
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
These tests were passing for the wrong reasons: they were checking
that an edge was absent, but they were looking for the wrong edge.
Fixed the tests to look for the right edge, and added counterexamples
to demonstrate that the edge is found under the circumstances where it
is expected.
Also, the test test_if_conditional_control_flow_after() contained a
TODO comment that has since been resolved. Deleted the TODO comment
and added a test demonstrating that the functionality now works.
Change-Id: I1442421401a54245a1299b643ccfbc1a71416d60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114520
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>