Commit Graph

1123 Commits

Author SHA1 Message Date
Paul Berry ab6d0ef178 Migration: change implicit downcasts to explicit ones when necessary.
Note that downcasts from dynamic may still be implicit.

Fixes #38481.

Change-Id: I35558ed3578707cc640108b85790adb042e88ee2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133865
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-30 21:33:12 +00:00
Janice Collins 1a6a5b997d Implement FantasyRepo.
Clone and update repositories.  Basic end to end test and a primitive
mocking setup using dependency injection for testing.

Change-Id: I3a61f6fd86da6d5b8d79c0124a756dbfc70c4614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133744
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-30 15:43:18 +00:00
Paul Berry 9b6394c484 Migration: Fix toFinalType for top bounds.
To avoid inserting unnecessarily complex casts, we want to normalize a
type like `void Function<T extends Object?>()` to the equivalent `void
Function<T>()`.

Change-Id: Ied10e7735511b732eaeca027e621b4ef6997df59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133820
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-30 04:06:10 +00:00
Paul Berry 2492661ed7 Migration: Add a type parameter to NodeChange.
This improves our type safety a bit, by making it clear from the type
of a NodeChange object what AST node types it is prepared to act on.

Change-Id: Ie1202cd5377aa31162d76e2da7a93d0edaa11fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133746
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-30 00:41:30 +00:00
Mike Fairhurst 124f9b3fe0 [nnbd_migration] Handle downcast from FutureOr<T> to T.
fixes https://github.com/dart-lang/sdk/issues/40364

Bug: https://github.com/dart-lang/sdk/issues/40364
Change-Id: I5e4b70e63daecfe9470127bcae4c5481c6e747f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133763
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-29 20:02:10 +00:00
Mike Fairhurst 6e53629f3b [nnbd_migration] Handle LUB(Never, C<T>).
Fixes https://github.com/dart-lang/sdk/issues/40363

Bug: https://github.com/dart-lang/sdk/issues/40363
Change-Id: I047a5ef9c58c22e6cf4603551015097049f1ac83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133662
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
2020-01-29 19:50:50 +00:00
Janice Collins 4ee5fd243f Move the parallelization restriction into SubprocessLauncher.
This eliminates a lot of really noisy boilerplate in the upcoming
FantasyRepo implementation.  The test only verifies that the pathway
works, we rely on MultiFutureTracker working to actually restrict
properly.

Change-Id: Ia88d0b24dd739ab1cd4a661325214395bf37eef3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133742
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2020-01-29 18:32:36 +00:00
Paul Berry 0ca9e8522e Migration: add explicit types to variable declarations when needed.
Partly addresses https://github.com/dart-lang/sdk/issues/39404.

Change-Id: Id8139b18bf8339df0eead48cc8648cb5f030acf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133741
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-29 18:30:46 +00:00
Paul Berry e0dff825b9 Migration: Add offsets to more inferred type nodes.
This should make it easier to understand the nullability graph when
debugging a test case.

Change-Id: Ic9cf1d8b460f76776b5433714ba3099cae00ccbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133740
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-29 18:30:46 +00:00
Paul Berry 208d8c2e52 Migration: Rework FixAggregator to reduce order dependencies.
Previously, FixAggregator provided one NodeChange-derived class for
each possible kind of fix; if multiple fixes had to be made to a
single AST node, its client (FixBuilder) was required to nest them in
the appropriate order.  FixBuilder accomplished this by carefully
controlling the order in which it decided on fixes.  Unfortunately,
this careful control of order is becoming burdensome for FixBuilder to
maintain.

With this change, the class hierarchy of NodeChange mirrors the class
hierarchy of AstNode, with different fields for each possible kind of
fix.  This means that FixBuilder can decide on fixes in whatever order
is convenient.

Change-Id: I1c79cfc37b6289051b3927c67867b77a1dbb5ebf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133541
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-29 18:30:46 +00:00
Paul Berry 7467988bbc Migration: simplify edit plans for changing ?. into ..
I realized that I can use the same "pass through" infrastructure for
these kinds of edits.  This should help prepare for a future CL in
which we can aggregate together more complex changes, such as
introducing an "as" cast at the same time as changing `?.` into `.`.

Change-Id: Ie3af07a3563c44d62d4ed34d2a477eef6fae358f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133540
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-29 18:30:46 +00:00
Paul Berry 62fe052908 Migration: Make sure that /*!*/ hints and already-migrated nullabilities can't be overridden.
Since https://dart-review.googlesource.com/c/sdk/+/133422 has
introduced the possibility that a node previously marked as
non-nullable would later be marked as nullable, we need to make sure
that doesn't happen for types that have been explicitly marked as
non-nullable using a "/*!*/" hint, or types that are non-nullable in
an already-migrated library.

This required refactoring the state of nullability nodes slightly.
Nodes can now be in six states:

1. Non-nullable (previously called "undetermined")

2. Non-nullable, with non-nullable intent (previously called
   "nonNullable")

3. Nullable

4. Nullable, with non-nullable intent (previously indistinguishable
   from 3)

5. Exact nullable

6. Exact nullable, with non-nullable intent (previously
   indistinguishable from 5)

To allow all these states to be distinguished, we separate the state
into two orthogonal parts: a "nullability" part and a "non-null
intent" part.

Change-Id: I588a2e63eaa76e3992fdfbaaa2e8b212cc1f60d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133440
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-29 18:30:46 +00:00
Paul Berry a49dce0631 Migration: remove the "propagation step" part of the instrumentation interface.
It didn't wind up being used, and its presence limits our ability to
modify the graph propagation algorithm (which I plan to do in a
follow-up CL).

Change-Id: I48a9b879f25295075e8d95eb3fb0185839303957
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133425
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-29 18:30:46 +00:00
Mike Fairhurst 3182edb74e [nnbd_migration] Fix usages of migrated typedefs
Change-Id: If92f5c6f78f4f68e9ef7a05674be42b5ac3d3cfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133600
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-29 18:13:40 +00:00
Janice Collins fe59e25492 Add ports of the tables in steamroll_ecosystem.sh.
Shifted some minor things around in the design as well -- particularly
the symlink is moved to being owned by the workspace as not all
workspace implementation will create symlinks in the original directory.

I've also dropped most of the public interface to FantasyWorkspace.
Will add that back in when I'm more sure what it will be.

Change-Id: I19d1b1c8ad4063868ff7c10869c4561d4db64bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133435
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-28 18:29:28 +00:00
Paul Berry 49c813a41e Migration: consider edges introduced by contravariant assignment to be uncheckable.
This prevents a non-null assertion in a callback function from marking
the parameter type as non-nullable, if that would make the callback
function fail to meet the requirements of its use site.  For example,
when migrating:

  f(List<int/*?*/> myList) => myList.map((int x) => x + 1);

We previously would produce:

  f(List<int?> myList) => myList.map((int x) => x + 1);

(Which would fail immediately due to the callback `(int x) => x + 1`
not accepting `int?`).  We now produce:

  f(List<int?> myList) => myList.map((int? x) => x! + 1);

(Which only fails if there is actually a null value in the list,
matching the behavior of the code prior to migration).

Addresses another manifestation of
https://github.com/dart-lang/sdk/issues/38699.

Change-Id: Iffe9fbdace00ff1edea0f6d125c86b06fad7bbcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133423
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-28 13:26:47 +00:00
Paul Berry e2e1993b94 Migartion: consider edges introduced by parameter overrides to be uncheckable.
This prevents a non-null assertion in an override from marking a base
class parameter as non-nullable.

Addresses one manifestation of https://github.com/dart-lang/sdk/issues/38699.

Change-Id: I8abc6829bb8de7a34a7e2c117a0c45a74e417771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133422
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-28 13:26:47 +00:00
Paul Berry 3517d7a859 Migration: allow a node to become nullable after being marked non-nullable.
Previously, graph propagation occurred in three steps:

1. Mark any nodes connected to `always` by union edges as nullable.

2. Mark any nodes connected to `never` by hard or union edges as
   non-nullable, but do not change any nodes marked by #1.

3. Mark any nodes connected to `always` as nullable, but do not change
   any nodes marked by #1 or #2 (with additional processing for
   substitution nodes).

This approach had the advantage that once a node is marked as nullable
or non-nullable, it is never changed, which made reasoning about the
algorithm a bit easier.  But in an upcoming CL I'll need to modify the
algorithm in a way that's incompatible with this approach.

This CL introduces the notion that some edges are "checkable" and some
aren't (an edge is "checkable" if it's ok for graph propagation to
leave it unsatisfied, because the fix builder can insert a null
check).  At the moment all edges are considered checkable except for
union edges, but that will change in future CLs in order to address
https://github.com/dart-lang/sdk/issues/38699.

The algorithm is now:

1. Mark any nodes connected to `never` by hard or union edges as
   non-nullable.

2. Mark any nodes connected to `always` as nullable, but only change
   nodes marked by #1 if necessary to satisfy uncheckable edges (with
   additional processing for substitution nodes).

An alternative way of thinking of this algorithm is that hard edges
reflect user intentions that we should try to satisfy if we can, but
which shouldn't take priority over creating output that is free of
static errors.  During phase 1, we propagate hard edges to find all
the nodes the user *intends* to make non-nullable.  During phase 2, we
propagate nullability, respecting user intention where we can, and
overriding it where we can't.

Change-Id: Ie3f9d9ee66f407f9d4916f7259e7f50a82ebb2bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133402
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-28 13:26:47 +00:00
Paul Berry da5ab8ce00 Separate graph propagation state and results out to their own class.
This serves two purposes:

1. It makes it easier to be confident that we're resetting the
   necessary state when re-running graph computation in
   `NullabilityGraph.update`.

2. I'm planning some changes to the graph propagation algorithm (in an
   upcoming CL).  Having the propagation state separate from the rest
   of the graph state will make it easier to reason about these
   changes.

Change-Id: I5e101bbce6e5ad382dd754bfbb9b72e20df23fd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133337
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-28 13:26:47 +00:00
Paul Berry 6a6c000046 Migration: change NullabilityGraph._debugDump output to graphviz format.
The console output of running NullabilityGraph._debugDump can now be
sent straight into graphviz (e.g. using
https://dreampuf.github.io/GraphvizOnline).

Change-Id: Icfb0fb51945735b756e8def2c55437e81422399c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133421
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-28 13:26:47 +00:00
Paul Berry 1298313e83 Migration: improve toString representation of some inferred type nodes.
Change-Id: I053dbb0500124dbd3e86d0e172836c0fcf99f385
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133420
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-28 13:26:47 +00:00
Paul Berry 2084137a7f Migration: fix warning in edge_builder.dart.
The visitSimpleIdentifier method was failing to return a DecoratedType
for the case where the identifier was `void`.

In practice this didn't matter, since the only time the type returned
from visitSimpleIdentifier is used is when the the identifier is used
as an expression, and `void` can't be used an expression (i.e. `var
voidType = void;` is illegal).

Nonetheless, it's nice to silence the warning, and it seems like it
increases safety to return a value from visitSimpleIdentifier in all
cases.

Change-Id: I239b98b9e5932195e6884738728d26d86c6ab519
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133336
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-28 13:26:47 +00:00
Paul Berry 1e01274bdf Sort methods in edge_builder_test.dart and migration_visitor_test_base.dart.
Change-Id: I14f9be6fabdd8df07d98f0e15edeebc07b625e30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133335
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-28 13:26:47 +00:00
Mike Fairhurst 3e453e5adf [nnbd_migration] union resolved typedef nodes with inferred ones
Change-Id: Iaccdc9e2f61219c876957377f15c8b43555661b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133430
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-27 22:08:09 +00:00
Janice Collins f0038ad8aa Move MultiFutureTracker and SubprocessLauncher into utilities.
Also adds some basic tests for both, centering on the functionality
that is most important to use in SubprocessLauncher's case.

Change-Id: I90a79cd12f7b2222bae366907a6dc200591bb59c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133433
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-27 21:34:19 +00:00
Janice Collins a1a888ec92 Boilerplate and basic flow for buildFantasyLand.
Does not actually implement much of anything, just enough connecting
tissue so that it's possible to review the overall design.

Change-Id: I991f9a4f65d1d23494cefd80ba8c3b4efdb3e572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133324
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-27 20:29:49 +00:00
Brian Wilkerson 4cc45ec612 Cleanup some analyzer hints
Change-Id: Iba36b028895c56ef1f9831ef00650fde6527fbfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133361
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-24 23:00:13 +00:00
Mike Fairhurst fb36ed007d [nnbd_migration] CompletenessTracker to ensure EdgeBuilder visits all types.
Moved AnnotationTracker to CompletenessTracker which defers work to
AnnotationTracker and new class TypeNameTracker.

This passes on flutter and p1/g1 packages.

Change-Id: I5c92ed287d4d35b2b2f0d21846db197e24584dc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133227
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-24 20:46:04 +00:00
Mike Fairhurst 3ab0defd92 [nnbd_migration] visit type names in type arguments
Change-Id: I89846cf30517b1d9def947e80724a16de85abe52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133320
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 9bd7eb62c2 [nnbd_migration] Don't visit spread elements twice
This will be tested once TypeNameChecker is landed; visiting the
a TypeName in a spread twice triggers that assertion.

Change-Id: Ibd9ca8269a88205051c2fd6746d7e5d648dbd139
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133249
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 482ea3c619 [nnbd_migration] fix typo in instrumentation test
Change-Id: I042d9ace734bb003898ab391922df56d6f5d562e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133248
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 11fa5a5322 [nnbd_migration] visit type names in factory constructors
Change-Id: Ia63a7031ee228a609d13b90ebad67177b38ee57b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133247
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 1d96bfcbe9 [nnbd_migration] visit type names in method type parameter bounds
Change-Id: I24ee455b58644734c38e783014e7e38b5650334d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133181
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 955e64bd6b [nnbd_migration] visit types in typed field formal parameters
Change-Id: Idb3d122b1fc4e4c0468152988bba3e4e9254c564
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 1c7ac2dce3 [nnbd_migration] visit type names in class aliases
Change-Id: I1c59119b9614d8fa5b14b618428771765bbb25d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133172
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst dd6829de6e [nnbd_migration] visit type names in mixin type parameter bounds
Change-Id: I214ce1a6c1e2de042eb091c0059633f8f2220542
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133157
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 5e23a103e9 [nnbd_migration] visit type names in extension extended type
Change-Id: Ib81bc5b2429fd4eeed87e4bc1527bda4c95cd3cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133155
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 36451c85a2 [nnbd_migration] visit type names in for-in loops (&test regular for)
Change-Id: I5b8b7b6a271e8dfa24e4c4cc0929f2c85939c663
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133152
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 1ae7b6655e [nnbd_migration] visit type names in explicit invocation arguments
Change-Id: Ie73edb11e6b0247eb312c7450811248f1f21d314
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133165
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 989fd9a628 [nnbd_migration] visit type names in instance creation parameters
Change-Id: I4ec3f1bd4984a731d7758ab6e000429351811f9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133147
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst ea14c4dee0 [nnbd_migration] visit type names in list, set, map literals
Change-Id: I19e20460154e0c05f0e115cae6cd79c36b8fb4b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133163
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 428fd51e19 [nnbd_migration] visit type names in method type parameter bounds
Change-Id: I4b0690f2d792430467f93be2aade6cd627b90016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst e9c26045c3 [nnbd_migration] Visit types names in local variables
Change-Id: Idcc84dfc630781e621e9adc356efd5e5d704bda2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133146
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst e6249d3667 [nnbd_migration] visit type names in type parameter bounds
Change-Id: I89a1d35d6f8e4746adbb64316f69a5bb74efe381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133145
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst d528bf9e13 [nnbd_migration] visit type names in extends/implements
Change-Id: I3e410861702c8f865c61942bc5d2d568b486035d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133144
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 5dafbe741b [nnbd_migration] visit type names in as casts
Change-Id: Ic38b274e09da497230473601a966950c478f3624
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133143
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Mike Fairhurst 08a0e830e1 [nnbd_migration] visit TypeNames for function return types
Change-Id: I04414338a4072f4e2b45318df387313cdb979e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133161
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-24 20:37:24 +00:00
Paul Berry 2edd8d17c0 Migration: replace ?. with . where appropriate.
Change-Id: Id32f60caec0c25099704652c03fafc8b184bf4d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133241
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-24 19:58:43 +00:00
Paul Berry 8714a7fa1d Abstract resolution calls to .isNullAware.
When migrating, we'll need to change some null-aware property accesses
and method calls to non-null-aware (due to the fact that the receiver
is non-nullable, or due to the new `?.` shortcut rules), so when
migration re-resolves, it will need to be able to override
resolution's determination of whether a given property access or
method call is null-aware.

Change-Id: I411f43fb937431e757d4dd9b968874db84158e47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133240
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-24 19:58:43 +00:00
Paul Berry 811ae9eb8d Sort declarations in api_test.dart
Change-Id: I7385a614b8d757f533602b9a5b4310fe2a87987d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133170
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-24 14:35:59 +00:00