Commit graph

1164 commits

Author SHA1 Message Date
Paul Berry b385528fee Migration: Write unit tests for NullabilityGraph.
Change-Id: I7d3ab1bde98ff28203dc73d61ecdc77e8fed25f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-12 13:34:57 +00:00
Paul Berry c286d5a549 Separate testing methods from the rest of NullabilityGraph
So that we don't accidentally start to use them elsewhere in the
migration engine.

Change-Id: Iee290f9fc8761c952a2aadb1f4f6bb7bfe061a3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 13:34:57 +00:00
Brian Wilkerson 97dc7f4482 Support constructor declarations (issue 37196)
Change-Id: I276e897a02c999c7c1ab08d12f51e5bd9676bb0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105543
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 20:56:36 +00:00
Brian Wilkerson ed9d185a9e Top-level getters do not have parameters
Change-Id: If8e079987f957538286afed162073fe4f323dea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105469
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 20:36:16 +00:00
Paul Berry 5ca5a53f64 Migration: Add support for generic function types.
Fixes #37212.

Change-Id: I3dfe0afa32564b9e4762f3410f5c44ea42d6d004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105467
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-10 20:29:59 +00:00
Paul Berry c2696591a6 Migration: Add more support for dynamic, clean up handling of void.
Change-Id: I0e83f614e58bcdbb4b1a37d20da4d97587d6bd5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105466
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 20:29:59 +00:00
Paul Berry 8b17b2e143 Migration: add support for null-aware accesses.
Change-Id: Ie034c0410e667f2e55fd2b9d9e9b2b3b3726de30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105465
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-10 19:53:06 +00:00
Paul Berry 881a2e9e48 Migration: remove unnecessary constructor argument
Change-Id: Ic544c37070d6ac3b874dc1a34d1709cf0949ff70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105441
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 18:11:30 +00:00
Paul Berry eba533dcd1 Migration: Clean up handling of LUB and substitution nodes.
Previously we created artifical edges from a LUB node's components to
the LUB node; now the nullability propagation algorithm understands
how to propagate nullability downstream through LUB and substitution
nodes, so no artificial edges are needed.

Change-Id: Ib2fef14c3dcd58a013ad8e057fd55597a1deb4fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105402
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 18:11:30 +00:00
Paul Berry 0a0927de9c Migration: Separate the implementation from the NNBD migration engine's public API.
Change-Id: I0ea000b9068661d4e9122414320202ebd4f8563b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105413
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 17:10:45 +00:00
Paul Berry 575a6424c3 Migration: Remove transitional API
Change-Id: I9853b7577ba4b39bf1d51f7d03ba3c2d6499e79b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105412
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 16:18:05 +00:00
Paul Berry e23b00745f Migration: Move classes out of transitional_api.dart
This paves the way for removing the transitional API altogether.

Change-Id: I95181b04173d3439d278f898ae3b5ec574108b32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105411
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 15:13:23 +00:00
Paul Berry 47865b7643 Migration: remove unused field Variables._graph.
It wasn't detected by the "unused field" hint because there is another
field in the same file with the same name that *is* used
(NullabilityMigration._graph).

Change-Id: I955f30d010ddaa2d218f61daf32978d391182708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105410
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 15:13:23 +00:00
Paul Berry 51046368c5 Move NNBD migration tool to a fresh package.
This gives us more flexibility for how we want to publish and deploy
the tool.  We now have the option, for example, of making a command
line app that invokes the tool and does not depend on analysis_server.

Note that some testing infrastructure had to be duplicated.  I plan to
consolidate this infrastructure in follow-up CLs.

Change-Id: I046506bc2bb5c3e467e15885f198ee0632351ee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105463
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-09 17:45:35 +00:00