Commit Graph

61 Commits

Author SHA1 Message Date
Sam Rawlins f6dba2b25f dart migrate: Separate HintAction and HintActionKind into separate file
This addresses a cyclic dependency build issue in google3.

Change-Id: I3ea917f7216e120b827577bde60b874a9bad52af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180240
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-01-20 21:54:53 +00:00
Konstantin Shcheglov c11039702c Replace FindElement.functionTypeAlias() with typeAlias().
Change-Id: I88a5b889310df8a39b54318907ba8bbd68b26b9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-12-15 07:13:41 +00:00
Konstantin Shcheglov 9717c775e4 Deprecate FunctionTypeAliasElement.function
Change-Id: Id629afa92c6681ba796aed75b24c4251fd86810f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176140
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-12-14 22:26:29 +00:00
Sam Rawlins 416cfa7c41 Migrator: Add /*required*/ hints when meta not imported.
Currently the migrator can add `@required` from the preview, which will crash
the preview upon rerunning, if package:meta is not imported.

This change instead adds a /*required*/ hint when meta is not imported.

Additionally, /*required*/ is understood by the migrator just as if it were
`@required`.

Fixes https://github.com/dart-lang/sdk/issues/43751

Change-Id: I1ea532246b956feacedd179146372b13c65003df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-11-02 17:30:59 +00:00
Sam Rawlins cddea627a7 Migrator: Accept 'late final' hint; same as 'late' hint
`late final` is not functionally different from `late`, as far
as the migrator is concerned; it is just an indication of late
in the face of missing initialization.

Fixes https://github.com/dart-lang/sdk/issues/41655

Change-Id: I1b0efd3de3b5c7064784ebd1e86c7d12436b1319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167203
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-13 19:41:58 +00:00
Paul Berry 2e261f9386 Migration: add locations to trace entries that refer to elements.
Bug: https://github.com/dart-lang/sdk/issues/41402
Change-Id: I0dc59ae9d64c6e8ab470b2ddcb5fd42557ba5704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148742
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-27 21:52:14 +00:00
Mike Fairhurst f943d994d3 [nnbd_migration] Support change hint type in stack trace
Change-Id: I715875bb72d4a19480c5f42e796b4ec4cabe3881
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148189
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-19 16:34:20 +00:00
Mike Fairhurst b21ee57ccd [nnbd_migration] Support remove hint action in stack traces
Change-Id: I2878fde38b233747d8cf9e3e8666b5768f3125fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148187
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-19 16:34:20 +00:00
Mike Fairhurst c18db7c8dd [nnbd_migration] Build hint actions in node builder.
Change-Id: I36428e72170d07f0f234aab0290365ca47f5b08a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147801
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-13 22:31:03 +00:00
Paul Berry f48e7e9f8a Migration: assign better quality node targets in NodeBuilder.
This should help ensure that descriptions of nullabilities that show
up in the stack trace refer to parts of the program the user is
familiar with, rather than simply saying "explicit type".

Change-Id: If53198cc45077a664e44859c7c0770ec9831c765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146964
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-05-08 12:40:49 +00:00
Paul Berry fdc13e3f43 Migration: remove hints when performing migration.
Previously, if we migrated a code snippet like this:

  void f(int/*?*/ i) {
    /*late*/ int j = i/*!*/;
  }

the migration result would leave the hints and add the hinted text,
resulting in:

  void f(int?/*?*/ i) {
    /*late*/ late int j = i!/*!*/;
  }

We now simply remove the `/*` and `*/` surrounding each hint (with
whitespace corrections as needed), to produce:

  void f(int? i) {
    late int j = i!;
  }

Change-Id: Ic4e1216cb4693d73d71c9ab1a37d5cc15b8ef334
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143460
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-04-17 00:17:15 +00:00
Paul Berry 40dacf82b9 Migration: add support for a late hint with spaces
Change-Id: If3a95283e4a70d41cfaee72a97525e69ec54be2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141917
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-04-03 16:18:51 +00:00
Paul Berry 4ffb95d631 Migration: add support for /*late*/ hints.
Fixes #41230.

Change-Id: I99b6ad67ebccbc972f72099818a8168003537fa5
Bug: https://github.com/dart-lang/sdk/issues/41230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141842
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-03-31 22:04:46 +00:00
Paul Berry 051d51f6be Migration: fix the descriptions of nullability nodes associated with parameters.
Previously, parameters with explicit types just got a description of
"explicit type"; now they get a description like "parameter 0 of
Foo.bar".

Change-Id: Ia6134fff48bc7d7e628304333f1c6ba406e8bdc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139957
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-03-19 14:45:39 +00:00
Paul Berry f2dd2e28f3 Migration: preserve code references for nullability nodes with explicit types.
Previously, when analyzing code like:

  int f() {}

We assigned a NullabilityNodeTarget for `int` that simply said it was
the return type of the element for `f`; the location of `int` in the
source code was lost.  With this CL, we produce the same target, but
we preserve the location information.

Change-Id: Ibfe11485aedf208a39947e5a4903b4fa738e86a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139954
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-03-19 09:03:17 +00:00
Sam Rawlins 43a5d7d80d Migrator: improve descriptions of return types in stack traces
Change-Id: Iaba43c4a3bf27ffb7913df6122eb9c0908795937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139180
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-03-12 16:56:36 +00:00
Paul Berry 2ec127a305 Migration: give nullability nodes human-readable names.
Change-Id: I86b510c6cc9afacb7d720af214c8f4e5a311c9ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138885
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-03-11 15:20:59 +00:00
Paul Berry 6a165950f5 Migration: do not allow RHS of a typedef to be marked as nullable.
We should consider the nullability of the right hand side of a typedef
to be "never", since a `?` is not allowed on there.  Instead, we
should allow each use of a typedef to have its own independent
nullability.

Fixes a bug wherein we would erroneously migrate code like this:

  typedef F<T> = int Function(T);
  F<String> f = null;

Into the following:

  typedef F<T> = int Function(T)?;
  F<String>? f = null;

(Note the bogus `?` after `int Function(T)`).

Change-Id: I8535645303fc644c73617684b8bb3488462589ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136900
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-02-25 16:21:21 +00:00
Paul Berry 4df17ee697 Migration: clean up how decorated type parameter bounds are tracked.
We now track decorated type parameter bounds similarly to how we track
ordinary type parameter bounds in the FixBuilder, by having a single
static instance of a DecoratedTypeParameterBounds class that keeps
track of the mapping.

Change-Id: I49196e8a506ca8765857b3d47a355b7aaaa1918e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134411
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-05 20:51:49 +00:00
Konstantin Shcheglov d025cd9378 Use DartType.getDisplayString() instead of toString().
Change-Id: Ibe5aa728058778bee42a1d87f4788da573a87d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134462
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-05 07:33:19 +00:00
Paul Berry 763ce812ea Migration: properly handle type parameter types with nullable bounds.
This required adding logic to the `TypeParameterType` case of the
`toFinalType` function, so that we look up the decorated type of the
type parameter bound, and convert it to a final type as well.
(Previously we were just using the bound stored in the element model,
which was in many cases the bounds from prior to migration, and hence
it was a `*` type so it behaved as though it was non-nullable).

This required moving `toFinalType` into the `Variables` class so that
it could look up the decorated types of type parameter bounds.

Fixes #40355.

Change-Id: I53c2636aef6954500589e924b9755a297c2b30f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134061
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-02-03 19:59:38 +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
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
Konstantin Shcheglov 39f14a000e Rewrite most getDisplayString() to ElementDisplayStringBuilder.
R=brianwilkerson@google.com

Change-Id: I500d0045873a12d550d9ffe302e066a63ba56660
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-06 16:43:40 +00:00
Paul Berry f525ddeaf3 Add/fix return types to NNBD migration tests.
This will be necessary in order to pass pedantic lints.  See
discussion in https://dart-review.googlesource.com/c/sdk/+/129325.

Change-Id: I61011a082a5401401fa1b7bb0d0bd7aed87a9d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129800
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-27 18:13:15 +00:00
Paul Berry f2b7af83e7 Migration: eliminate some explicit uses of always/never nodes from node_builder.dart.
Change-Id: I40a23b907016dca537073834e4ec1280c8acaf2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125931
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-22 15:17:54 +00:00
Paul Berry 8452d2d188 Migration: change behavior of dynamic.
Previously, when the migration engine found a type that was implicitly
or explicitly dynamic, it assumed the type was meant to be nullable.
This seemed reasonable (since, after migration, `dynamic` indeed
allows null), but it caused unnecessary nullabilities to be
propagated.  With this change, the migration engine tracks whether
dynamic types can be nullable or not, just as it does for all other
types.  This cleans up a number of tricky corner cases in the
migration engine that were getting in the way of fixing up uses of
`always` and `never` nodes.

Note that if a `dynamic` type is determined to be non-nullable, it
will still be `dynamic` after migration; this change merely prevents
nullabilities from being needlessly propagated from that dynamic type
to other types.

Note that we still assume `dynamic` is nullable when it occurs in an
already-migrated library or as the result of a dynamic dispatch.

Change-Id: I380d0907f3489d0b84f3fdd7164113daae24274e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125084
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-11-13 23:10:15 +00:00
Konstantin Shcheglov a8e48405dd Share search methods in FindElement and ImportFindElement.
Change-Id: I511c23440fbd95b3a27a50d7b80c66c9a8a7f558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125125
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-13 22:22:25 +00:00
Konstantin Shcheglov 8119253f64 Include space after comma in FunctionType.toString().
R=brianwilkerson@google.com

Change-Id: I6a30f98c11bc85d2c1afb0d86ba40160e11e85e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-04 19:00:26 +00:00
Paul Berry 21ee71c3e5 Migration: favor explicit /*?*/ comments over hard edges.
Change-Id: I9bc6dcb7a21af24e1a6ce6918f098c9686ab40c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119121
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-28 12:51:15 +00:00
Paul Berry e227ffa955 Migration: improve handling of catch clauses.
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>
2019-09-06 21:58:25 +00:00
Mike Fairhurst 91de97f7e6 [nnbd_migration] Unwrap handles and remove handle assertion.
Change-Id: I58c5f47ec294a7b49d58147dd3a95759abb79e73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113920
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-26 22:45:40 +00:00
Paul Berry 33e03fe65f Migration: node builder support for uses of typedefs.
Change-Id: Ib8222f68b9f57672ad1037bc246a0c5c17a721c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114344
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-23 16:20:48 +00:00
Paul Berry 83458092ef Migration: add support for inferred types that are generic function types.
Change-Id: I36bbc43b8c070f65eb06063ed02ea733489f4cf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114049
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-22 12:39:12 +00:00
Paul Berry b569bf048e Migration: node builder support for new-style typedefs.
Change-Id: Idc0fa7523cca7a49d833b5e97a7712021fcae6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-21 20:35:43 +00:00
Paul Berry 0323fb97bc Migration: support Function() syntax with type formal parameters.
Change-Id: Ib1ab632eb4546d1bd8b71493b7d72f299244fb4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113945
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-21 16:06:11 +00:00
Paul Berry d252efaa49 Migration: node builder support for old-style typedefs
Change-Id: I39fa3415d10993c0eff4ec12ad148a9f9772bebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113943
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-21 15:01:59 +00:00
Paul Berry e34c4319dc Migration: property decorate implicit bottom types.
Change-Id: I5af76bbfb888ce25642cf61e590862b1b471d4b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-20 15:20:00 +00:00
Paul Berry 4938e4564c Migration: add support for local functions and function expressions.
Change-Id: Icf089c40f219503b42aea744f043249f672b2ed6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113240
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-08-16 14:12:17 +00:00
Paul Berry a5772382dc Migration: refactor infrastructure for testing decorated types.
I have a lot more testing of decorated types to land in follow-up CLs;
this CL introduces a mixin containing helper methods that should make
that testing a lot easier.

Change-Id: I29c17ffb4af65498fcd85704dc404343429e09ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112847
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-13 16:49:14 +00:00
Paul Berry 1f7e6370b4 Migration: store decorated type parameter bounds separately from other element decorated types.
We will need some special treatment for decorated type parameter
bounds, because sometimes we will need to create type parameters
(e.g. when comparing decorated types).  So we store the bounds of
non-ephemeral type parameters (the ones whose enclosing element is
non-null) in the Variables data structure, and we store the bounds of
ephemeral type parameters (the ones whose enclosing element is null)
in an expando.

Change-Id: I918c9baffedab9a8871ecea37c8101b5ef44a5d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112743
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-12 17:56:45 +00:00
Paul Berry e147c3e0c8 Migration: ensure that NodeBuilder visits executable metadata and constructor initializers.
Change-Id: I9969e9f35f89a91890f9ef15d6505df5c36c1b0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-07-30 12:43:37 +00:00
danrubel e0eeffaf9b update NodeBuilder parameter tracking when visiting executable declarations
This updates NodeBuilder so that when it visits a method declaration,
it does not count any parameters defined in body statements
as part of the parameters defined in the method signature.

Change-Id: I4da3989eb2bc65c422d94fa264885910850b0ed2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107921
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-07-02 17:39:33 +00:00
Paul Berry 77aa5f0c02 Migration: Add support for function-typed formal parameters.
Change-Id: Iae4ba1c052e854bc832fdba7a2e2f53635d5033d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107749
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-02 10:23:21 +00:00
Paul Berry 79f276e07d Migration: handle field formal parameters.
Change-Id: I15fb64a2cb7ed9bc56593fc8b27170aaa34af8a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107743
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-30 16:39:17 +00:00
Paul Berry b57ff85906 Migration: clean up and test implicit dynamic return type of Function() syntax.
Change-Id: I6a010f5aa32cee4ece094188992ba472444293c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107519
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-30 16:39:17 +00:00
Paul Berry a200980da0 Migration: add support for variable and field type inference.
Change-Id: Iae66992d4f9734438776af34b68aabf20f5c15d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107517
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-30 16:39:17 +00:00
Paul Berry ca25f56883 Migration: add support for type inference of function types.
Change-Id: Ic0ebbc4d412e7273127564089431ebe9058ee790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107516
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-30 16:39:17 +00:00
Paul Berry f7ddfdf6ca Migration: don't forget to visit variable initializers in NodeBuilder.
Also visit any annotations present in a variable declaration (we can't
yet test this part well but we might as well add the proper code now).

Change-Id: I1c8f19c9516d1e0f17f024fa136bd7d331ed8ae1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107643
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-30 10:43:45 +00:00
Paul Berry a5070b88de Migration: Remove unused variables from test.
Change-Id: Id052dea7d4f1c464fd57c9482ee8f37cec4e014b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107640
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-28 14:09:55 +00:00