Commit Graph

788 Commits

Author SHA1 Message Date
Paul Berry f69935b107 Migration: stop creating union edges for inferred types.
Fixes #38341.

Change-Id: I77e6bebc28ca917a13e5fd9958f5a7b3e0284834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125448
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-18 17:14:23 +00:00
Paul Berry 33c95a8508 Migration: account for definite assignment.
Fixes #38344.

Change-Id: I64d17fe1e571fc708632c0e48b6556e2094a91e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125443
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-15 22:38:36 +00:00
Sam Rawlins 15e5c23167 nnbd preview tool: Better text when inserting 'required'
Helps with #39247

Change-Id: I3bb7b25c73d58fc49260d6e3019b58b2f3f6b80a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125440
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-15 22:20:16 +00:00
Paul Berry 249a9172f7 Migration: don't mark fields as nullable due to factory and redirecting constructors.
Change-Id: I4b60a2bea125089d86e2368b3e674adf5ef402aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125460
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-15 21:08:06 +00:00
Paul Berry 9cb0b678ce Migration: remove more explicit uses of never from EdgeBuilder.
With this change, we no longer use the "never" graph node for:

- instance creations

- explicit references to `this` or `super`

- the static type of `throw` and `rethrow` expressions

Change-Id: I995be86ee0f4d8002c70cf98e7e5d2767529d00b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125226
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-15 02:02:35 +00:00
Paul Berry ad4b93da9e Migration: stop using the "never" node for the type of literals.
Change-Id: I4195dd989d295dc9a468ada0e643c9a971f3a9d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125223
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-14 18:25:29 +00:00
Paul Berry eeb89b2e5b Migration: ensure that uninitialized fields are nullable.
Change-Id: I1dc0a2c80ea52566aa4eb6b5e9ce745ad635d517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125220
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-14 17:03:07 +00:00
Paul Berry a2894e7864 Migration: make use of _graph.make(Non)?Nullable in EdgeBuilder.
This eliminates a few direct references to `always` and `never` nodes
from the edge builder.  It also fixes a latent bug where we were
failing to create a hard edge when handling "is" expressions.

Change-Id: I4c88432c97932eac3554cfcb75bbd634c0e2e4c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-14 16:56:06 +00:00
Paul Berry 3bd7ed38fb Migration: fix handling of bound -> type param downcast.
I don't recall what I was thinking when I decided to change the
nullability of the type to "always" when doing this downcast--AFAICT
it doesn't make any sense.

Change-Id: I41d1d2a30722010d2b9b93bb53979ce881e24319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124905
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-14 14:03:16 +00:00
Paul Berry 22b2a35b9f Add failing test for issue #39376
Change-Id: I3dc72f24824c13a54542602fdf4d10055bfec6f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125122
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-11-13 23:10:15 +00:00
Paul Berry 5767cc1bfd Migration: do not use "always" node for dynamic dispatches in EdgeBuilder.
Change-Id: Ic9b62287d11e4adfe14082834fde8bee01624a28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-11-13 23:10:15 +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
Paul Berry 8938a5ed2d Migration: make an edge origin for assignments of dynamic.
Change-Id: I75d037aa7ee890488a92e113f58094b5733a9b8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125004
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-13 00:27:32 +00:00
Konstantin Shcheglov c9ef7cc5e3 Deprecate Member.baseElement, use Element.declaration in analyzer.
Change-Id: I91d23558c7d0bd8ffa2e251e5d615d4e026923b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124940
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-12 22:35:07 +00:00
Paul Berry 3793a40e6a Migration: stop using always for decorating the type of explicit nulls.
Change-Id: I950c9b8e80bc647c5a42b5cb5c66babd7c4d41e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125008
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-12 22:19:16 +00:00
Konstantin Shcheglov 6cde7ce224 Deprecate synthetic FunctionTypeImpl constructor.
Change-Id: I7c2f834d7e9e532709b3d43b348e7588be659af9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124595
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-11 19:38:53 +00:00
Paul Berry 7c78ab75a5 Migration: allow already-migrated libraries to be opted in.
A core assumption of the migration tool is that the code being
migrated may have some dependencies that have already been migrated
(e.g. the SDK itself).  Of course these dependencies will need to be
analyzed as "opted in" libraries so that they can have nullability
annotations.

However, when the migration tool was first being developed, we didn't
yet have a migrated SDK, so the SDK was opted out and we just had to
pretend that it was opted in.

This CL prepares to switch over to a truly opted-in SDK by updating
the AlreadyMigratedCodeDecorator to handle opted-in code.

Change-Id: I797752401f8c7bf7cdf8d26d03d00d3d213a5127
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124466
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-08 13:53:17 +00:00
Paul Berry 7e8e66016a Migration: do not use always or never in already-migrated types.
Previously, when the code being migrated referred to a nullable or a
non-nullable type in an already-migrated library, we would use the
`always` or `never` graph node to represent the nullability of the
type.  This was problematic, because it made it difficult for
instrumentation to pinpoint precisely which element in an
already-migrated library was the cause of an expresion being
null-checked, or a type being made non-nullable.

We now create a fresh nullability node for each non-nullable type
coming from already-migrated code, with an edge to `always` or `never`
to ensure that the fresh node has the correct nullability, so that
instrumentation can see precisely which element it came from.

Since the migration tool doesn't traverse the ASTs of already-migrated
code, we can't report an AST node that caused such an edge, so an
`element` getter has been added EdgeOriginInfo to allow us to report
the element that caused the edge.

As before, types associated with already-migrated code are reported to
instrumentation via InstrumentationListener.externalDecoratedType.  As
a new enhancement, bounds of generic parameters in already-migrated
code are reported to instrumentation via
InstrumentationListener.externalDecoratedTypeParameterBound.

Change-Id: Ided4e96e2920f8d9062688f5a6fda29b9b71dd12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-11-08 13:53:17 +00:00
Konstantin Shcheglov cb0e5c5a3e Set operator== parameter type to dynamic if directly from Object.
See https://github.com/dart-lang/language/issues/569

See https://github.com/dart-lang/sdk/issues/38339

Change-Id: I8d42135985aa4d55ffcc65cdf849572736cb9198
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124284
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-07 20:07:29 +00:00
Brian Wilkerson b647e327aa Fix an assertion to support migration of part files
I'm not sure where the test for this should go. I found it while
migrating vector_math.dart.

Change-Id: I0c1c5ba91375b2a36540f4c270cef6dc9558a745
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124103
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-06 20:18:31 +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
Konstantin Shcheglov 2438fe10cb Rename BottomTypeImpl to NeverTypeImpl.
The corresponding element is Never, and the spec says "the type Never".

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Icb6427ef13fa6ee74bd07d5345e68402a1b90b6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123943
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-03 19:03:02 +00:00
Brian Wilkerson 9bffff6dfc Fix exception in migration of ?? operator when the right hand side is a generic type
Change-Id: Ie372522f9493e2ccea8284f8583b0f43153adbbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123884
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-01 21:52:48 +00:00
Brian Wilkerson eab70c2673 Visit annotations on classes in EdgeBuilder
This also makes the annotation tracker an instance field rather than a
static field.

Change-Id: I3f636047b7cbddc98536cd10b209e22546d6019b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123694
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-01 15:45:52 +00:00
Mike Fairhurst 924ec34e01 Remove analysis logger, replace with calls to InstrumentationService
Change-Id: Ifddd58b731aa0af8f76a91261757997dc52a9fc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123328
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-31 21:26:44 +00:00
Konstantin Shcheglov 8a7ffc5b81 Make InterfaceTypeImpl.typeArguments final.
Change-Id: I51af8de355dd994005419ccfc593f3f4fbd988cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-28 15:47:27 +00:00
Konstantin Shcheglov bad583a9fc Always provide nullability suffix to FunctionType constructor.
Bug: https://github.com/dart-lang/sdk/issues/39111
Change-Id: Id91a5c3f559446fbbcc02d6f9465780d287deb29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123020
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-25 18:53:46 +00:00
Paul Berry 0167f91012 Flow analysis: introduce ID tests for AssignedVariables.
This should make it easier to verify that the CFE implementation is
correct.

Note that this effort encountered a few bugs in the analyzer
implementation, which are marked with TODOs.  I will fix them in
follow-up CLs.

Change-Id: Ic164a1cf214b5730f848b17db2838c29d25b00d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122850
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-25 13:44:05 +00:00
Paul Berry 696a374b6f Flow analysis: properly handle the fact that ++ and -- are assignments.
Change-Id: Ie54fbf7c7c750457b2750de90c64e8ea32db15d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122730
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-24 17:57:27 +00:00
Paul Berry 8f5a45c22d Flow analysis: add support for ??=.
Change-Id: I8c99c42cf3a2560d7af3daf27ee316e22a2eb027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122588
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-24 17:57:27 +00:00
Paul Berry b7911e4490 Flow analysis: add support for asserts.
Fixes #38761.

Change-Id: I6cc4adc0383cc56d99fa73ef75f728db0c56063b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122732
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-24 17:01:33 +00:00
Paul Berry 92c69f224b Flow analysis: promote on successful execution of an "as" expression.
Change-Id: I506281ab2dfe23b4b75daf795028fec979006932
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122586
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-23 17:02:37 +00:00
Paul Berry 8e23f76ac7 Flow analysis: properly handle promotion of type parameters.
When promoting a type parameter, we need to create an intersection
type (e.g. "T & int").  Such a type is represented in the analyzer and
the front end as a type parameter type pointing to the same type
variable, but with a different bound.

Change-Id: I1655f9242d913ca958c279cc80c3f6329f6b396d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-23 15:50:10 +00:00
Paul Berry 22dbc7d748 Migration: FixBuilder support for function expression invocations.
Change-Id: Iad5740dbdc15d8b78a30a87031ab22cf1c171c8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-20 23:23:24 +00:00
Paul Berry dce3d0591f Migration: Fix three broken FixBuilder unit tests.
These tests were all broken due to incorrect nullabilities in a
generic class method.  The brokenness was masked by issue #38900,
which was fixed in 1b044eec08.

Change-Id: Ib77c437ae147afd10cc46e0685db25ce844bd99b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-17 16:09:30 +00:00
Paul Berry 8eb28a4817 Migration: add simple MethodInvocation support to FixBuilder.
Change-Id: Ice76583076a3f38d1cc0f9a3aacbac630a9a97c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121763
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-17 16:09:30 +00:00
Paul Berry ca9671f34d Migration: add isUpstreamTriggered getter
It would have been very useful in helping to track down
https://github.com/dart-lang/sdk/issues/38341#issuecomment-542892773
to have this information surfaced through the instrumentation output.

Specifically, it would be nice if the user could hover over a type
annotation that was *not* made nullable due to a propagationStep whose
`reason` was `StateChangeReason.upstream`, and see information about
all the edges for which the `sourceNode` corresponds to that type and
`isUpstreamTriggered` returns `true`.  These are, in effect, the edges
that prevented the type from being marked nullable.

(Note that there's another possible reason a type might not be marked
nullable.  It might be that there are no edges for which the
`destinationNode` corresponds to that type and `isTriggered` returns
`true`.  In this case, the node is indeterminate, so the migration
engine left it as non-nullable because there was no need to make it
nullable).

Change-Id: I9b969201b813496d41f3a373454c2659f683178d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121941
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-17 15:52:11 +00:00
Paul Berry c52ac7b114 Migration: ensure that the target of cascade expressions is visited exactly once.
Fixes #38922.

Change-Id: I451b44055f9039a21e4ab50c473573809bb15c2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121905
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-17 02:58:01 +00:00
Konstantin Shcheglov 1b044eec08 Combine nullabilities during substitution.
Bug: https://github.com/dart-lang/sdk/issues/38900
Change-Id: I1bccb87ba863f3c075eacbf6cca499a12d4cb3b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121921
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-17 02:47:31 +00:00
Paul Berry a9d0987476 Migration: generalize FixBuilder's representation of changes to be made to the code.
Change-Id: Id17f70778a4e2c7b5410c02ebee59f1f19e5af9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-16 23:30:16 +00:00
Paul Berry cf7e48bec7 Migration: Handle members of Object properly in FixBuilder.
This code is shared with similar code in EdgeBuilder.

Change-Id: I807269a21472be396e7ba42a89f20efa15eca7fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121523
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:44:10 +00:00
Paul Berry 7bdbbc4ec4 Fix "unused variable" warning
Change-Id: I425e82b1eb67b76dc56c7c450c9c20f7c6eb4a00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:44:10 +00:00
Paul Berry 878458d7b5 Migration: Add FixBuilder support for property accesses and prefixed identifiers.
Change-Id: I15bbcf6674432c50871aecdd1354c58a2174a6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:44:10 +00:00
Paul Berry 1e3cbd4344 Migration: Add IndexExpression support to FixBuilder.
Change-Id: I870047d12304c70cfe89e64d4864cc1809b7e4ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121408
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 5594981c2a Migration: add isCompound parameter to FixBuilder.visitAssignmentTarget.
When visiting an assignment target that is an index expression
(`x[y]`) we'll need to know whether we are doing a compound assignment
or not, because this will influence whether the type context for the
index expression (`y`) should come from `operator[]` or `operator[]=`.

So before adding index expression support to FixBuilder, let's add an
`isCompound` boolean to indicate whether the assignment context is a
compound assignment or not.

Change-Id: I26a41544e10ef9c9ba042c1d7862563bd9d18b68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121407
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 13f6d8213b Migration: add FixBuilder support for prefix/postfix expressions.
Change-Id: I62a705af1c8d9944a417d074373aca4c93e99b6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121402
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 0121a1fce1 Migration: finish EdgeBuilder support for prefix/postfix expressions.
A few changes here:

- Prefix expressions didn't support dynamic invocations.

- Prefix expressions didn't support generic types.

- Postfix expressions were handled incorrectly (we used the return
  type of operator+ for `x++`, whereas the type should have been the
  same as the type of `x`).

Change-Id: I35077b82a6e9c4e4f6ad8bb1264f5d725ec0d9a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121401
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry d2f9e83861 Migration: integrate flow analysis of ?? into FixBuilder
Change-Id: I3d576c704ffd0b3b44fff0ceb442e355790ecb84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121342
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 04d800af49 Migration: add fixBuilder support for throw and conditional expressions
Change-Id: Iea9bc71cb7f173340b7eb56f241985bd2c90f609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121341
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00