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>
This should make it easier to notice when we get to the point where a
new package can be migrated without exceptions.
At the moment we can migrate one package without exceptions: charcode.
Change-Id: Icef71ad3dca0e1a25bb5e42f4b2691e90c44ec2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114583
Reviewed-by: Konstantin Shcheglov <scheglov@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>
Previously we had a single class, DecoratedTypeAnnotation, which
coupled together DecoratedType and PotentialModification, allowing one
object to serve both roles. But this won't work for typedef
instantiations, because they will need to be associated with a
potential modification, but they will be created using the shared
infrastructure for inferred types (which just creates a plain
DecoratedType). The solution is to decouple the two roles into two
separate objects.
Change-Id: Idf518def87d950d013e958f13dd94f23803f7113
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114046
Reviewed-by: Dan Rubel <danrubel@google.com>
Support creating decorated types for already migrated interface types
that have type arguments, so far as those type arguments equal in number
to the interface type's type parameters. This includes basic cases like
List<int>, which is tested as an api_test.
Reduces AlreadyMigratedCodeDecorator.decorate exceptions from 915 to
538.
Change-Id: Ic82d7fb598db964bfc2ca37898795f124796eba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113750
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
These tests were accidentally moved into
edge_builder_flow_analysis_test.dart, but they don't test flow
analysis. Moving them back to edge_builder_test.dart.
Change-Id: I701b8785d43c7ddb50b16ad25bd4061057638ed8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>