Commit Graph

788 Commits

Author SHA1 Message Date
Paul Berry 4f4d1bdf10 Migration: Add if-statement and block-statement support to FixBuilder.
Change-Id: I3e3f0b3824a9a51b63f9ee8ffbe414415fc2b2e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121340
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 27967490f6 Migration: add FixBuilder support for typed lists of expressions.
Change-Id: I30a36e9925fdd5a409b87a98962709de1ed3168b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121263
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 14d4b93349 Migration: update FixBuilder to handle simple statements.
We now handle expression statements and variable declaration
statements where the variable type is an interface type.

Change-Id: I00f53a326495bcbeeba785b25c46abf1f3e9ab49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121260
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 61790a17b6 Flow analysis: add support for non-null assertion operator.
Change-Id: I7a60944a4389b6f7c8e182d5c9b402fcbb05b624
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 4e9220efdb Flow analysis: change the way parenthesized expressions are handled.
Instead of forcing the client to provide a way to de-parenthesize an
expression, the client informs flow analysis when a parenthesized
expression is encountered.  This reduces the runtime overhead to zero
for non-parenthesized expressions, and it saves the front end from
having to worry about support for parenthesized expressions (since its
internal representation doesn't care about parentheses).

Change-Id: I0bb6e91c87acaa05591e1b075da18700b11e4aae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121080
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 88b76997c4 Flow analysis: rework handling of closures.
Rather than suppress all promotions for variables written to in
closures, we track whether a closure might exist that captures a write
to a variable, and only suppress promotions once such a closure
exists.  This is consistent with what is proposed in
https://github.com/dart-lang/language/pull/473.

Contains a repro of #38791.

Change-Id: I4683581908703b510a3231b8fa8ed697121b09da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-09 18:24:08 +00:00
Paul Berry 144b8eda81 Flow analysis: track variables captured in closures more accurately.
Previously, we considered a variable to be captured by a closure if a
write to that variable occurred anywhere inside a local function.  But
that was overly broad; it meant that we incorrectly classified all
written-to local variables of a local function to be captured.

This CL makes the AssignedVariables logic aware of variable
declaration sites, so that it only considers a variable to be captured
if it is written to at a lower level of local function nesting than
its declaration.  As a side bonus, it means that it can now exclude
out-of-scope variables from all sets of closed-upon and written-to
variables, which should make flow analysis faster by preventing it
from spending a lot of time accounting for variables that aren't
visible.

It also adds tracking of the set of all variables written to and
captured within each top level function.

This partially reverts commit 55466fd3cc.

Change-Id: Ibcd6476445addebed13cfc5ecc470d644e519148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-09 17:34:51 +00:00
Paul Berry 2f1e430646 Flow analysis: track assigned variables separately for each top level declaration.
In a follow-up CL, I'm going to add logic to track the complete set of
assigned and captured variables seen so far.  We will need these sets
in order to properly cancel promotions on entry to a closure or nested
function.  But for performance reasons we don't want these sets to
include all variables seen in the entire file; just the local function
is sufficient.

Change-Id: I32a42075916be791f2fb7798814cec4c020e8b3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120751
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-09 17:34:51 +00:00
Mike Fairhurst ee42196636 [nnbd_migration] Support async function expression bodies.
This fixes 10 "side casts" (from T to Future<T>).

FutureOr logic no longer needs to be specialized as _handleAssignment
now supports that.

Change-Id: Ie01b13797a49ec29b4eb723f580720f1caffffab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120420
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-08 20:37:58 +00:00
Paul Berry 8ba6f7e2eb Migration: add support for assignment expressions to FixBuilder.
Change-Id: I8e9a76cd3a0952341bd7b354ca4deddee6496b7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119525
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-07 13:45:59 +00:00
Paul Berry 6364c599b6 Migration: substitute properly when handling compound assignments.
Change-Id: Ib8f26959688df3b2fc6aa2db66331ef0ec357794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-07 13:45:59 +00:00
Mike Fairhurst a447dbc498 [nnbd_migration] fix hard edges on ??= assignments
Change-Id: Ie2731e723147189591302e411d1dcb7540e09b23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119762
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-10-04 19:34:26 +00:00
Mike Fairhurst c3053f0eb2 [nnbd_migration] Restrict downcasts; make all type parameters nullable.
This makes trial_migration.dart report two new exceptions:

_EdgeBuilder&GeneralizingAstVisitor&_AssignmentChecker._checkAssignment (package:nnbd_migration/src/edge_builder.dart:2169:14) (x30)
_EdgeBuilder&GeneralizingAstVisitor&_AssignmentChecker._checkDowncast (package:nnbd_migration/src/edge_builder.dart:2351:14) (x7)

30 & 7 is not great but not terrible. These also do not break path, logging, or
charcode.

Failing tests show why we cannot correctly cover remaining cases without
a larger CL.

Change-Id: I6e510db147f60cc8ee047d45e4ce2d95d26cccc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119533
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-10-04 18:31:48 +00:00
Paul Berry 9f8caeaf4c Migration: begin creating a third visitor class.
This visitor, once completed, will visit code after migration is
complete, determining the post-migration type of each expression, and
deciding where null checks are needed.

See #38472 for more information about why this is necessary.

Change-Id: I8c7dece643cf5417dbb66d5290fcdbad68d3e690
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-30 20:21:44 +00:00
Paul Berry 200e5b668d Migration: extract decoratedClassHierarchy from EdgeBuilder.
This will allow it to be re-used when we traverse input files for a
third time to generate modifications.

Change-Id: I0984484a90eb2ecb87f848ee70c03280ec69cecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119124
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-29 12:36:47 +00:00
Paul Berry caaa577b0c Migration: add support for user-definable operators on generic classes
Change-Id: I2153c5ac3000c0617dfbe5654d57c3c21c74431d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119122
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-28 14:21:56 +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 2cbaaba7ad Migration: add logic for converting a decorated type to its final post-migration form.
Change-Id: I392736634ccc87696068611f671e08238de9122e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119063
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-27 16:35:24 +00:00
Paul Berry f7b6169e18 Migration: add required keyword instead of @required annotation.
Fixes #38461.

Bug: https://github.com/dart-lang/sdk/issues/38461
Change-Id: Ibe3ba234fce9d1293ef862fad6f785e9abed964e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-25 19:14:53 +00:00
Paul Berry 605384dbe7 Migration: Add nullability_migration_impl_test.dart to test_all
Change-Id: I8fb3d642744bf3a7c7889e2cfa71733db6c489ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118060
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-19 16:02:16 +00:00
Paul Berry 23def0da02 Migration: add support for assert initializers.
Change-Id: I581550e4359a256f846c05d4c4cec60082b4ab01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-19 13:16:06 +00:00
Paul Berry 8ffe04bcf7 Migration: integrate flow analysis for "is" checks.
Fixes #38340.

Change-Id: I881f71f4dbbdc75b33433bca15445b0677ef04d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117775
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-19 13:16:06 +00:00
Paul Berry a85b7cef95 Migration: Add support for for-each loop variables.
Change-Id: If5536394a99e4706c3916d360e7ac051e18a97f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117772
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-19 13:16:06 +00:00
Paul Berry 430ff6d649 Migration: fix "matching" functionality of edge testing infrastructure.
Change-Id: I6318f89ba962329a1d3f4b0af2b0352981d6c9fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117840
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-19 00:26:14 +00:00
Paul Berry 93793a4ee8 Migration: add tests to document missing required keyword functionality.
See #38461 and #38462.

Change-Id: I94da796e0d21578c9838ae0eb9c477f4a21e054e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117771
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-18 20:46:25 +00:00
Konstantin Shcheglov 4102e63f37 Deprecate TypeProvider.listType/mapType
R=brianwilkerson@google.com

Change-Id: I7cef0b752be4ef6a7e4bc5394e14cd64ecb67ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117765
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-18 17:55:03 +00:00
Konstantin Shcheglov 4fcef04d61 Deprecate TypeProvider.iterableType/streamType
R=paulberry@google.com

Change-Id: Iab8038cf0ed413de7c05da4f69015c1d1309aa35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117684
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-18 17:29:58 +00:00
Paul Berry 998a421128 Migration: expose fix reasons through the instrumentation interface.
Change-Id: I0f8ba9aa58d098b431fad338d46a2f14d87e43b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117686
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-18 15:52:50 +00:00
Paul Berry a5683dfb62 Migration: add a repro for an issue with field formal parameters.
See #38453.

Change-Id: I7ecf1c020437b7e332e7646cc40e947f38a081bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117687
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-18 15:45:22 +00:00
Konstantin Shcheglov d4f1b8f8db Deprecate TypeProvider.futureType/futureOrType
R=paulberry@google.com

Change-Id: Idde7d82b217b5921c0770d9b69f6934a1e1fc493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117682
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-18 15:37:21 +00:00
Paul Berry 7f90b562be Migration: clean up nomenclature of graph edge "sources".
Instead of having a set of sources, of which one is the primary
source, we now have a set of upstream nodes, of which one is the
source node.

Change-Id: I580a4d91ee2d242eabe0e614b196951840d7cc7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-17 15:53:02 +00:00
Paul Berry 9bb9c05f92 Rename EdgeInfo.hard to EdgeInfo.isHard
Change-Id: Iff38a9f5fa13b1447cbdbddcd9ef1061a82b6a66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117465
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-17 15:53:02 +00:00
Paul Berry 478e3cfe87 Migration: test and fix a few more instrumentation corner cases.
Change-Id: I09f6837cd6c3c64c45887a164a3fffd3bec5f6a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117462
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-17 15:53:02 +00:00
Mike Fairhurst 1222a97e46 [nnbd_migration] principle is check types non-null, component types nullable
Change-Id: Ie02341d0f92ae9f72404b5ffd5b3f81e929f4906
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117213
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-16 22:33:06 +00:00
Konstantin Shcheglov 6a9d792454 Move NullabilitySuffix to API.
R=brianwilkerson@google.com

Change-Id: I58547075d3472e6708e6b5ff1c6d89f768aba66a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-16 21:14:11 +00:00
Paul Berry 4ae145e173 Migration: Introduce an instrumentation interface.
This interface is a callback interface that allows the client to
receive detailed information about the decisions made by the migration
tool, and the source code locations associated with those decisions.
The idea is that a client of this interface can put together a report
to the user to help them understand the behavior of the migration
tool.

The instrumentation interface mostly exposes internals of the
migration engine through some safe, non-destructive interfaces.  The
interface itself is documented in the new file
pkg/nnbd_migration/lib/instrumentation.dart.  For examples of what
information the client can expect to receive through the
instrumentation interface, see the new file
pkg/nnbd_migration/test/instrumentation_test.dart.

Change-Id: I079551922bff75e0e8d290819f31533c29d7b62f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-16 20:57:41 +00:00
Paul Berry b53b425195 Migration: change EdgeOrigin classes to store AST nodes rather than offsets.
This will allow richer information to be passed back to the client
about how the nullability graph relates to the source code.

Also in this CL: eliminate the _CompoundOperatorInfo class, since
everything it tracked was already available from the
AssignmentExpression AST node.

Change-Id: I3f2a37d7cbef2c69358b5f68667f8ff8afafc517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117283
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-16 18:31:08 +00:00
Paul Berry 233189e598 Migration: clean up EdgeOrigin class hierarchy.
This CL combines the EdgeOrigin and EdgeOriginWithLocation classes, so
that all EdgeOrigin objects are associated with source locations.  And
it separates the EdgeOrigin and PotentialModification roles of the
ExpressionChecks class into two separate classes.

This will enable a follow-up CL that switches the EdgeOrigin class
over to track source locations via AST nodes rather than offsets,
which will in turn allow rich information to be delivered to the
client about how the nullability graph relates to source code.

Change-Id: I736f60f93681fbbfbd5f9ee9a5589f99f819b9aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117282
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-16 18:31:08 +00:00
Paul Berry 74db01f1c2 Migration: Remove edge origins from GraphEdge data structure.
This will pave the way for a follow-up CL that stores AST nodes in
EdgeOrigin objects without bloating memory usage; that in turn will
prepare for an instrumentation interface that allows the migration
client to gather useful details about how the nullability graph
relates to the source code.

Change-Id: I3689ee68de7c9969776564db4678e8c1e0344519
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117281
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-16 18:31:08 +00:00
Paul Berry c5c2c1bcca Migration: Fix assignment of FutureOr<T> to FutureOr<U>.
This should address ~12 exceptions whose stack trace includes the line:

_AssignmentChecker._checkAssignment_recursion (package:nnbd_migration/src/edge_builder.dart:2153:16)

Change-Id: I8375cfcc4e11b5c12c75e465d9de0af060b860dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117160
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-09-16 16:57:50 +00:00
Konstantin Shcheglov f470695875 Stop using ClassElement/TypeParameterElement.type in tests.
There are 4 references to `type` left in tests, because it looks
that these tests validate peculiarities of the `type` getter itself.
I will remove them later, when the production code is off `type`.

R=brianwilkerson@google.com

Change-Id: I4b8a590e561fe3d3103500b097c13d989514976e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-16 15:53:29 +00:00
Paul Berry f8f7a5a6c1 Migration: add a test case documenting the need for definite assignment integration
See #38344.

Change-Id: Icaef1c645843746fd88f33b910dd940ae893e67e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116884
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-13 14:51:32 +00:00
Paul Berry 366b4056e6 Migration: add a test case documenting a problem with back-propagation of non-nullability
See #38341.

Change-Id: I74cfc40a1db60e3dce10352ac3945a23fe591e95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116882
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-13 14:51:32 +00:00
Paul Berry 29ce9350d3 Migration: add a test case documenting a problem with "is" checks.
See #38340.

Change-Id: If6517cecb9c97796e0ff93ddebfa4afe51b96c0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-12 17:53:26 +00:00
Paul Berry 152fbbb1d9 Migration: add a test case documenting an operator== corner case.
See #38339.

Change-Id: I98bf1f2931d57f5973326abef22f0f3bd3e9f911
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116827
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-12 17:53:26 +00:00
Paul Berry 1bbee6119d Migration: handle binary expressions whose LHS has type dynamic.
Should address ~21 exceptions whose stack trace includes the line

EdgeBuilder.visitBinaryExpression (package:nnbd_migration/src/edge_builder.dart:374:14)

Change-Id: I884ac0884e4249028219ca7ba374ec95a0849d7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116683
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-11 00:25:14 +00:00
Paul Berry 75fd88cf8c Migration: handle dynamic function expression invocations.
Should address ~17 exceptions whose stack trace contains the line:

EdgeBuilder._handleInvocationArguments (package:nnbd_migration/src/edge_builder.dart:1783:21)

Change-Id: I05eb69ac5a1bbda67bd080f5c9db4fd66ee1f8bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-09-11 00:25:14 +00:00
Paul Berry eeb1716660 Migration: don't forget to visit arguments to dynamic invocations.
Change-Id: Id2a6e09d7d7b5ac68e4a2f15612243c729fa4392
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116557
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-09-11 00:25:14 +00:00
Paul Berry 3cccd7f117 Migration: handle ??= assignments.
This should address ~24 exceptions whose stack trace contains the line:

EdgeBuilder.visitAssignmentExpression (package:nnbd_migration/src/edge_builder.dart:278:7)

Change-Id: I63cbc48422aeb85f49731dc479c8203a9fd6fecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116554
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-11 00:25:14 +00:00
Paul Berry 79137ed65f Migration: create flow anaylsis before visiting parameters.
This is necessary in case any parameters are found that trigger flow
analysis methods to be called.

Should address ~24 exceptions whose stack trace contains the line:

EdgeBuilder.visitBooleanLiteral (package:nnbd_migration/src/edge_builder.dart:390:19)

Change-Id: I08dc31a8acdaaf0685516aab872905f620602806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116488
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-10 22:08:02 +00:00