Commit Graph

936 Commits

Author SHA1 Message Date
Paul Berry 236d952dae Migration: fix broken reasons for dead code elimination
Change-Id: I949c41e7ecdad4e332e5a7c28e1419754de89203
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132450
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-21 15:58:02 +00:00
Paul Berry 5a7bb50905 Migration: generalize creation of unique IDs for source spans
Previously, we used the offset of an AST node as a unique ID to
represent it, with a special hack to make sure we can distinguish a
generic function type from its return type (which has the same
offset).  But in an upcoming CL, I will need to start associating
unique IDs with expressions, so that will bring up a whole bunch more
ambiguity.

This CL switches to a technique where we combine the offset and the
end of any source span into a single unique identifier.  The algorithm
produces an output that is no larger than the square of either input.
Since we have 64-bit integers in Dart, this should be adequate for any
reasonable input file size.

Change-Id: I68ce27533eb485cc824e1080326d02de98bff1e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132404
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-21 15:58:02 +00:00
Paul Berry 31bfacfda4 Migration: change API to make use of FixBuilder's "changes" data structure.
The new FixBuilder component of the migration engine communicates the
changes it produces using a "changes" data structure of type Map<int,
List<AtomicEdit>>, and is not compatible with the old
SingleNullabilityFix class (which made the incorrect assumption that
each SourceEdit was associated with a single fix).  This CL changes
the migration engine's instrumentation API to use this data structure,
and changes its listener API to avoid reference to the
SingleNullabilityFix class.  This allows SingleNullabilityFix to be
deleted.

This required changing AtomicEditWithReason so that it can hold
multiple fix reasons, and a NullabilityFixDescription.  It does so
using a new object, AtomicEditInfo, and AtomicEditWithReason is
renamed to AtomicEditWithInfo.

In addition, the old FixInfo class is removed, since it carries the
same information as the new AtomicEditWithInfo class.

This required deleting the "incremental workflow" functionality from
UnitRenderer.  This functionality was disabled, and I believe it
wouldn't have worked anyway (since it, too, made the incorrect
assumption that each SourceEdit was associated with a single fix).

Change-Id: Id965cfd803b408c66f15436017b87fc3e46521c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132306
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-19 16:50:01 +00:00
Paul Berry 5dff804997 Migration: handle code changes within a non-dead branch of an if.
The FixBuilder implemenation is now at feature parity with the
non-FixBuilder implementation when testing with api_test.dart, except
for one test of extension functionality (which doesn't seem worth
fixing right now, since extensions are still so rarely used).

Change-Id: I89df7ec388824fa9f4181706bfadbaeb232d2b5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132169
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-17 20:47:16 +00:00
Paul Berry f656cad5f4 Migration: add support for converting @required to required.
Support only exists in the FixBuilder.

Change-Id: I921bd40058fb3b10321fbccf8eae61e02473ff4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132220
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-17 20:47:16 +00:00
Paul Berry cacfb70f7b Migration: further support for adding ?s to types in FixBuilder.
Previously, we tried to hook in to the resolver so that every time it
tried to check the type of a TypeAnnotation, the FixBuilder would see
if it needed to add a `?` to it before letting the resolver continue.
This was clumsy and didn't catch all the TypeAnnotations.  This CL
changes to a simpler technique where we simply visit all
TypeAnnotations, making note of where we need to add `?`s and updating
types, prior to re-running resolution.

Change-Id: Idf5ba286415fb2b90e2cd1d5ba3635b6b559aef6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132164
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-17 20:47:16 +00:00
Paul Berry f1df196ddf Migration: add FixBuilder support for enums
Change-Id: I2ab1fa367d17f827cd229ebfa0f1e7a055134ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131944
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 22:03:48 +00:00
Paul Berry b0786edaba Migration: additional support for collection literals.
In particular, we now properly propagate changes to explicit type
arguments down into the collection elements.

Change-Id: Ia3f5fbc0679b7d5d561c1243d28ff6148b85a941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131942
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 22:03:48 +00:00
Paul Berry 37753f016c Add methods to CollectionElementProvider to get type arguments of typed literals.
We will need to hook into this for migration as well, because the type
arguments of typed literals will be changed by migration from star
types to either nullable or non-nullable types.

Change-Id: Ie721390effd9cf733b9f977c1ba729f6fc4b2ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 22:03:48 +00:00
Paul Berry 3af7abc78b Migration: Remove source parameter from MigrationResolutionHooks API.
The source is already known to the FixBuilder, so it is redundant.

Change-Id: Iafafd6514bbe469ebc2136a65984b388f5c64342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131881
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 22:03:48 +00:00
Paul Berry fa02e7d8cd Migration: add collection element caching to MigrationResolutionHooksImpl.
This should make the fix builder faster, since TypedLiteralResolver
has to query the elements of various collections multiple times.

Change-Id: If49317b8e095b49b693e8a4885914a631efd6d2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131844
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 22:03:48 +00:00
Paul Berry 3f02e7d749 Migration: add FixBuilder support for generic function type annotations.
Change-Id: Ifca6d611da8d95cfc243c32a3af8bd3a1f03bd54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131880
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 22:03:48 +00:00
Paul Berry 2b756f6b02 Migration: add FixBuilder support for IfElement.
One minor issue remains: when dead code elimination causes a
collection to become empty, migration should insert explicit type
parameter(s) to ensure that the empty collection will still get
analyzed as having the right type.  This is noted in TODO comments.

Change-Id: Ibed25f6cb8ed9eec3ddccb0444178960c6b35c84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131843
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 06:45:35 +00:00
Mike Fairhurst 689e0feab2 [nnbd_migration] Mark implicit dynamic for type params as nullable
Looks like we used to do this, but we stopped when we started changing
this pattern:

```
dynamic x = 1;
int y = x;
```

Our first iteration treated `dynamic` as nullable all the time. This is
not ideal in the example above. So we went back and instead began
treating `dynamic` as nullable only when it was observed to have a null
value.

However, in the case of unbounded type parameters:

```
class C<T> {}
```

We don't want to wait to observe:

```
C<Object> o = C(null);
```

before treating the bound as nullable.

Change-Id: I50b8ca6188d82cd62f795ada99a355afe2eae771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131714
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-15 19:50:16 +00:00
Paul Berry 8ff8fdb1c2 Migration: small simplification to _PassThroughBuilderImpl.
Instead of storing planIndex in the class (which makes it hard to
follow what methods are expected to update it, and consequently hard
to tell that _processPlans will process each plan exactly once), pass
it between _processPlans and _handleRemoveEditPlans so that it's
clearer how it is updated.

Change-Id: I1b03ad2b8bb0ae5e488d02827d2a4a56f37ede21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131711
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-15 13:00:53 +00:00
Paul Berry 9786c9c063 Migration: wire up elimination of dead if branches to FixBuilder.
Change-Id: I317c2476aa21e556333729893872b937a46a82e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131583
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-14 20:41:23 +00:00
Paul Berry a57350be7b Migration: Add logic to FixAggregator to eliminate dead "if" branches.
Change-Id: Icfe62535f588c691086835ae22c80b49191be514
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-14 20:41:23 +00:00
Paul Berry 1eb5f10c27 Migration: add the ability to create EditPlans that remove source code.
This will allow for dead code elimination.

Change-Id: I128dddcfe5e83dde351512ebffb14ea7088c8b9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-14 20:41:23 +00:00
Paul Berry da2a3aee27 Migration: Add tests for the algorithm used by EditPlaner.passThrough.
Change-Id: Ie405bb95d735f96eb4605558a9ed22d4877f150a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131484
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-14 20:41:23 +00:00
Paul Berry 6bee2660eb Migration: Remove _incorporateParent method.
We no longer need this--all of its functionality is now implemented in
EditPlanner.passThrough.

Change-Id: I54c1b22fed99443b8ca3844bea1903c48a5f36eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-14 20:41:23 +00:00
Paul Berry 2c121e4ecd Migration: modify pass through edit plans to integrate up the tree stepwise.
Consider a generic AST structure like this:

   A
  / \
 B   C
    / \
   D   E

Previously, if we wanted to build a "pass through" edit plan for A,
incorporating inner plans representing changes to be made to B, D, and
F, we would do the following: (1) pass each inner plan through the
_incorporateParent function, which might leave it unchanged or might
produce a plan targeted at the parent node, and then (2) ask each
inner plan for its set of changes, and produce a new plan for A
containing those changes.

The purpose of step (1) was to allow an edit plan to describe changes
that might affect the node above it.  For example, changing an
expression might cause the parentheses surrounding it to become
unnecessary, so those parentheses would be removed (that's the case
that's currently implemented).  Or, removing a list element from a
list might necessitate adjusting the comma before or after it, which
belongs to the parent node (this isn't implemented yet).

This had a design flaw: step (1) might produce overlapping changes.
For instance, calling _incorporateParent on the plans for D and E
might conceivably both plans for C, and those plans might try to make
overlapping (and thus incompatible) changes to node C.

It turns out that this isn't a problem for eliminating unnecessary
parens, because it's impossible for two edit plans to target two
different non-overlapping AST nodes whose parents are both the same
ParenthesizedExpression node (because a ParenthesizedExpression has
only one child).  But it will be a problem for removing elements
lists, statements from blocks, declarations from classes, etc.

The new strategy is that we will bubble inner plans up the tree one
level at a time.  In the example above, we would first combine the
inner plans for D and E into a pass through plan for C.  Then we would
combine the plans for B and C into a plan for A.  This is a bit more
work, but I believe it can be made efficient in typical use cases, and
it will avoid the problem described above because at each stage, all
the inner plans we combine will have the same parent, so it will be
tractable to figure out their interactions with each other.

Some vestiges of the old _incorporateParent approach still remain; I
plan to remove them in a follow-up CL.

Change-Id: I9ecbdb1549b949177ffc5d66447d4aede77e2dd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131400
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-13 23:26:33 +00:00
Brian Wilkerson c8f2683ebc Add a reason to the MakeNullable change and plumb it through to the AtomicEdit
Change-Id: I5a0a258b07e12fa9a43efc219c1af0c021380716
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130939
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-13 21:20:58 +00:00
Paul Berry 9b0cf08847 Split EditPlan into a base and derived class.
The derived class, NodeProducingEditPlan, represents an edit plan
whose effect will be to transform the source AST node into another AST
node (e.g. replace an expression with one of its subexpressions).  The
base class, EditPlan, will be able to represent more general kinds of
edit plans.

Future CLs will introduce edit plans that don't result in an AST node,
e.g. an edit plan that removes a source statement or a collection
element, or an edit plan that replaces one source statement or
collection element with several.

Change-Id: I01455f643b858c6500d864be679b12768029cffb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130941
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-10 22:10:32 +00:00
Brian Wilkerson c75e2796f1 Make AtomicEdit concrete and remove subclasses
Change-Id: Iff7d591e8278cae074f76ca2e8cf561503bf4149
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131120
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-10 21:06:41 +00:00
Paul Berry 38453843fb Migration: annotate API tests that assume dead code is commented out.
In later CL's, I will make it possible for dead code to be deleted
instead of commented out.  This change prepares for that, by
explicitly noting which API tests assume that dead code is commented
out.

Change-Id: I4e0ff6f1de4c0ab5fda050956944725b2d23dc5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130931
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-10 20:42:32 +00:00
Mike Fairhurst 693c3c444d [nnbd_migration] Make list constructor nullable if specified length
Change-Id: Ia65768ddf6c7da11a44b362d3c99cc0372a14e84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130891
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-10 20:41:01 +00:00
Paul Berry ccca7a009c Migration: move finalize method into EditPlanner.
In upcoming CLs, I'm going to need access to the EditPlanner when
finalizing edit plans, and I'd rather do so by making finalize a
method on EditPlanner.  Doing so now to make future code reviews
simpler.

Change-Id: I6182e2224b548b2919f0c8f454f558b72c17e5d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130926
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-10 19:45:21 +00:00
Sam Rawlins 0091273e36 Migrator: edge between extension 'on' type and invocation targets; #40023
Change-Id: Ia2f30acec0da2449567d93f99b4c0b0a583c07ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130960
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-10 02:01:17 +00:00
Paul Berry 2199e94d37 Migration: begin integrating FixBuilder.
Since the FixBuilder-based implementation is not yet fully baked, we
only enable the integration in api_test.dart for now.  The remaining
failing test cases are marked with a `@FailingTest` annotation
pointing to https://github.com/dart-lang/sdk/issues/38472, which is
the tracking bug for the FixBuilder implementation.

Change-Id: I761350fff125cec8067a96fdfc593b381e5feb3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130882
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-09 20:01:16 +00:00
Paul Berry cab2998a27 EditPlanner: add the ability to comment out code rather than removing it.
Change-Id: I6ba621d6482321104f6741772fef46753c599179
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129803
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-09 15:59:36 +00:00
Sam Rawlins 894d318b33 Migrator: initial support for extensions; #40023
Change-Id: I90829077e63f3c3ae2a31e3ead0da947e4275823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130729
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-09 15:43:16 +00:00
Paul Berry 73561e5a29 Create a factory interface for creating EditPlans: EditPlanner.
This factory class serves three purposes:

- In a future CL, it will contain fields to customize the global
  behavior of the edit plans that are created (e.g. whether code
  should be removed or commented out).

- In a future CL, it will contain a pointer to the original (text)
  contents of the source file.  This will allow edit plans to make
  more sophisticated changes such as adjusting indentation.

- In a future CL, it will contain methods for creating common kinds of
  "extract" edit plans such as null-checking an expression or making a
  type nullable.  (Currently the client must create these edit plans
  using EditPlanner.extract, which has an error-prone API).

Change-Id: I87ac75b73003d0e7b416e3d2121eadb2770da5ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129802
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-09 05:22:57 +00:00
Paul Berry c81efbe59a Change NodeChange.apply to accept a FixAggregator rather than a callback.
This will facilitate a follow-up CL that introduces a factory class
for creating EditPlans.

Change-Id: I4fa82371844388f3042107375eb1e7a7e9804647
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129801
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-09 05:22:57 +00:00
Paul Berry 6da2ded062 Migration: simplify "extract" edit plans by always deferring change computation.
Change-Id: Ie1b66e2034bd9f111e9f491addef101d0c192974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-09 05:22:57 +00:00
Paul Berry d4f40220b1 Migration: Teach FixBuilder not to append ? to void type.
Change-Id: I80e932c9a16cb13b8978531bcd5fe28693e01124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129328
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-09 05:22:57 +00:00
Mike Fairhurst 8b777dd829 [nnbd_migration] fix flow analysis for function declarations
We were getting a static error in package:logging for

```dart
Zone recordingZone;
// ...

runZoned(() {
  recordingZone = Zone.current;
  // ...
});

// ...
expect(records.first.zone, equals(recordingZone));
```

That is a static error if we don't make `recordingZone` late or
nullable.

Change-Id: Iab5e47dd8df375c7dc5283ce4570ad1321ba919e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130738
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-09 00:09:25 +00:00
Konstantin Shcheglov 1fee7f0263 Remove unnecessary casts to TypeImpl.
Change-Id: I48dcc4a448fa60551905c3d73c8df90a31230738
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130572
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-08 17:22:30 +00:00
Konstantin Shcheglov 9e7c401d4f InterfaceTypeImpl has one constructor.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iea88ae0fa035ffa7154460ac61752cf90dc004c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130571
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-08 06:16:23 +00:00
Mike Fairhurst 75a93bce5e [nnbd_migration] Fix Enum.toString(), the last exception in flutter.
Turns out the flow analysis bug was actually an issue with calling
toString() on an enum. This happened to throw the same type of exception
as caused by the shared part file, so it blended in. Flow analysis was
not itself broken.

Tested the other methods on enum too, but no others seemed to have this
problem.

Change-Id: I5e9e1be3f02adf0177c276c63d0c4f4fa2cb94db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130622
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-08 01:38:19 +00:00
Mike Fairhurst 053fb6ad56 [nnbd_migration] Fix compound downcasts involving Object -> void
Change-Id: I5d26c0e5123bd717f55f3489335d53167c08a889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-06 21:46:33 +00:00
Mike Fairhurst 1c7f1f16a2 [nnbd_migration] Unwrap legacy member elements into their NNBD declarations
Change-Id: I4a2d445625716a61c00f970f04a95af8aaa918fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128101
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-06 21:46:10 +00:00
Mike Fairhurst 033422b8cf [nnbd_migration] preserve type formals in DecoratedType.withNode()
Change-Id: I44ef4374714b02a497ae0981a8de1db9e593b029
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130181
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-06 18:06:21 +00:00
Mike Fairhurst 6e7a900283 [nnbd_migration] Fix ConditionalModification on IfElement
Change-Id: I1e8ec4bead2aaa9147850d27cd5ac4d9c2a700be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130137
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-03 23:47:50 +00:00
Mike Fairhurst 2f453dcf5a [nnbd_migration] handle yoda conditions with null literals
Change-Id: Id848e71e22c2adb2e96a372dde1e1d8fffe87805
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130136
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-03 23:39:47 +00:00
Mike Fairhurst 610c1e41a0 [nnbd_migration] handle Object better, to fix void -> Object assignments
Change-Id: Ibd2fa86578e76dc79f402cae2a21b01223af90aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130127
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-03 22:02:31 +00:00
Mike Fairhurst 0e0bc8e1a6 [nnbd_migration] Save enum index getter in the node builder
Change-Id: I1714244a18471f0ac489a2bf7a4de2e6b5c0c3cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130102
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-03 20:21:49 +00:00
Mike Fairhurst 44e3627f29 [nnbd_migration] Support mixins, specifically super on a mixin.
Change-Id: Ia0d61b8faebfba22933af8d8f902e272b27d4f6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130060
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-03 19:21:49 +00:00
Mike Fairhurst 29e89f512d [nnbd_migration] Fix return Bottom from async function.
Change-Id: I4de22568a5540d9796f4668ad3d69dfb2a15109c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129818
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-02 21:58:16 +00:00
Mike Fairhurst c89c373e87 [nnbd_migration] handle enum values getter
Change-Id: I268ced7d3a002ff41dc1e75b6a376acb3af88fa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129541
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-01-02 21:18:11 +00:00
Paul Berry 1317212b22 Migration: teach FixBuilder to add the required keyword when necessary.
Change-Id: Ifb20e60f1ea8578bcdcfe503582902734d56b881
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129326
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-12-28 23:50:56 +00:00