Commit Graph

936 Commits

Author SHA1 Message Date
Mike Fairhurst 80f4497da7 [nnbd_migration] Handle invokeType on function invocation expression
It also looks like the old clause detecting method invocations on
variables is no longer relevant. Removing it does not fail any tests,
p1g1 packages, or sdk/third_party/pkg/ packages.

Change-Id: Idcab49f00c6b5b38ba5f2ecf3f2a45787c13376a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129817
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-12-28 23:36:16 +00:00
Mike Fairhurst 1bdd4f69da [nnbd_migration] Visit annotations in field formal parameters
Change-Id: I6bd3bd98cf3571fe101eb4623c11425915da0613
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129809
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-27 21:26:35 +00:00
Mike Fairhurst 52d568a9ea [nnbd_migration] fix crash by composing non-null/type promotion
There were cases where types that are promoted with current type
promotion were not being promoted with improved type promotion due to
null-checks:

```dart
void f(x) {
  if (x == null) {
    return;
  }

  if (x is ...) ...
}
```

This was causing a bad state when trying to substitute type parameters
on methods if promotion usually succeeded.

Fix the crash by allowing migration to promote a non-null type to a new
type, and make that new type an intersection of the new type and
non-null.

```dart
  if (x == null) {
  } else if (x is List<int/*1*/>/*2*/) { // promote to List<int/*1*/>!
```

Change-Id: Icf9f74eb2b3eef887a29d4bfab7556ac126f49e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129540
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-12-27 19:53:46 +00:00
Konstantin Shcheglov 2fb3f09948 Extract TypeProvider class into lib/dart/element/type_provider.dart file
Change-Id: I96cdfccc33e35a9625c14a89a08826758eac0f2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129601
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-26 21:31:04 +00:00
Mike Fairhurst 0eb4af17a1 [nnbd_migration] fix returning null from async fn
Change-Id: I7f13149b9d486f434f9db174f5ec3e0fcfb79dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-23 23:13:10 +00:00
Mike Fairhurst a9e91396a7 [nnbd_migration] Support enums
Change-Id: Ib15b821691168359d0b31b185b5c7deb7da3c7e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-23 23:13:02 +00:00
Mike Fairhurst 2df7aaa659 [nnbd_migration] Fix method calls on newly promoted types.
Consider:

```dart
List<num> x;
if (x is! List<int>) return;
x.toSet();
```

In this case, `x.toSet()` gets a `targetType` of `List<int>` due to new
promotion. However, the element of `toSet` is `Set<num> Function()`.

We provide the correct `targetType` in `getOrComputeElementType`, with
the correct substitution T/int. However, the resulting element has the
incorrect member substitutions T/num.

It is therefore no longer worth providing the `undecoratedResult`
argument, because it is not the correct answer. The only way to get the
correct answer is to undo the member substitutions, and reapply the new
substitutions. This is what `.substitute` already does. This plus other
CLs to always provide the implicit `this` type, together mean that this
code does everything it needs to.

In case this was done for performance, I timed it A:B, and both took

1:13s to perform trial_migration.sh
Change-Id: Iecf7e6893d56ec96af735814e5c9acb13854f67d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129329
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-23 18:53:50 +00:00
Paul Berry 7a94decac4 Migration: modify FixBuilder to make use of the NodeChange type from FixAggregator.
This will allow FixBuilder and FixAggregator to be integrated together.
I have a branch in which they are integrated, but it is currently
failing some tests due to missing functionality in FixBuilder, so I'll
work on implementing the missing functionality before completing the
migration.

Change-Id: If3fd64665eef8a8373e5679978e3724eee6689da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129306
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-12-22 15:16:16 +00:00
Paul Berry 8ce84595c5 Introduce a FixAggregator.
FixAggregator will form the last stage of the migration engine, taking
the output of FixBuilder (which is a map from AST nodes to individual
changes) and feeding it into the EditPlan infrastructure to produce
the complete set of edits for any given file.

In a follow-up CL, I will modify FixBuilder to make use of the
NodeChange classes defined here.

Change-Id: I73fd67d7e989194049d91f978a7d9134814d3265
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129304
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-12-22 15:16:16 +00:00
Paul Berry 4c2f3669b2 Introduce EditPlan, a builder class for creating source edits with automatic parenthesis management.
Initially this will be used in the NNBD migration engine to produce
migration output.  Assuming it proves useful, in a future CL I'd like
to consider moving it to the analyzer_plugin package and using it as a
basic for all of the analysis server's refactorings.

Change-Id: I41ffc578ace3945fcfebb8eb824b6b5706dfba6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129302
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-12-20 22:43:54 +00:00
Mike Fairhurst c260e4e8da [nnbd_migration] Handle downcast from Iterable<T> to List<T>
Change-Id: Iee4a0e2c7bbd8fbc0a09e62d7edd5908c923a787
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129262
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-20 20:29:54 +00:00
Mike Fairhurst 43f74824c2 [nnbd_migration] Substitute type parameters for implicit super
Change-Id: Icfe46c4cc0950cafef07e8448f82985c04ce20ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129260
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-20 18:18:51 +00:00
Mike Fairhurst 4681868aaf [nnbd_migration] Fix TypeParameterType asInstanceOf where valid.
Change-Id: I033b378d0e87ead2bacad27d71a0c696904d8e15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128985
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-20 02:05:49 +00:00
Mike Fairhurst 6efbe7f3ce [nnbd_migration] Handle downcasting type arguments.
There are no examples of a downcast involving a nullable type in the
current set of working packages. This tells me that it's rare, and that
this behavior should be good enough.

If we're wrong, this unblocks packages and we can revisit this decision
later.

Change-Id: Ic4e23cc6a848b83b2d1fb6c97ff513c3cc9fdb2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128778
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-18 20:02:56 +00:00
Paul Berry e87c625fbe Migration: Re-architect FixBuilder to use the analyzer resolver.
This CL establishes the scaffolding for the new FixBuilder
architecture, and gets most of the previous tests to pass.

Several TODOs remain, which I plan to address in future CLs, however I
want to get the FixBuilder running end-to-end before doing so, so I
will work on that next.

Change-Id: Ic68b04c70b6cb8c72d04f00f9a027c3498f3acbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128562
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-12-18 19:22:46 +00:00
Mike Fairhurst a4e3bcbe42 [nnbd_migration] Fix assertion failure in _forTypeParameterSubstitution when not fresh
Change-Id: I1f372f5dd4925e58a4803a20680c052c553c4dc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128304
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-16 22:24:33 +00:00
Mike Fairhurst b3194cab7d [nnbd_migration] handle downcast from Function to a function type
Change-Id: I8a574aed910951dcd35ec1d4e74018dcfc2b24c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-16 18:58:53 +00:00
Mike Fairhurst 1c07a828e8 [nnbd_migration] Handle downcast from dynamic to function types
Change-Id: Ic47165217778f1ff8c9375cdd40e9daecc0099f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128284
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-16 18:58:53 +00:00
Paul Berry 1befb89903 Migration: Modify FixBuilder tests in preparation for rewrite.
In an upcoming CL, I will be replacing the FixBuilder with an
implementation that re-uses resolution logic from the analyzer.  Due
to complexities with the analyzer's scope management, it won't be as
easy to test individual visit methods in isolation anymore, so this CL
modifies the FixBuilder tests so that they each visit an entire
compilation unit rather than just one or two AST nodes; this will
allow landing the rewritten FixBuilder without making further
significant test changes.

Note that in order to land this CL I had to had some temporary hacks
to the FixBuilder so that it could visit top level constructs
correctly.  These hacks will go away when the rewritten FixBuilder is
landed.

Change-Id: Iffaaaa382070aa87c368e6fcc28034030a34b4ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128484
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-12-16 14:12:01 +00:00
Mike Fairhurst 80467ce51e [nnbd_migration] Return simple LUB node for LUB(T, T) for type parameter type T
Change-Id: I3e70a5a9f5e43210fdc70f91e936014a0ad04fa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128221
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-12-12 21:13:31 +00:00
Mike Fairhurst 9d2ea5a5f6 [nnbd_migration] handle LUB(A<T>, B<T>)
Change-Id: I24dd44537cddc4cb04c9d9f7b198b132b2a44381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128220
Reviewed-by: Paul Berry <paulberry@google.com>
2019-12-12 21:13:31 +00:00
Mike Fairhurst 10f7cb4e32 [nnbd_migration] handle LUB(null, T) for type parameters
Change-Id: I6ea65366f5c6003d486d794aaf161ff65adbf04f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-12 21:13:31 +00:00
Mike Fairhurst f4055b59a9 [nnbd_migration] Handle LUB(null, Function)
Change-Id: I5fe091d35cc53dd244f76c911a6a76873298662e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128084
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-12 21:07:01 +00:00
Mike Fairhurst be2df7d600 [nnbd_migration] Assert GLB(null, S) cannot produce C<T>
Change-Id: Ifc213a1761a0d46f2b8eb326c0c8963d1160aa56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-12-12 21:07:01 +00:00
Mike Fairhurst def408b24a [nnbd_migration] Handle LUB(null, C<A, B, ..., Z>)
Fixes #39269

Change-Id: I43961b13a2ec4b3409d97123afae5df37af8e137
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128082
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-12-12 21:07:01 +00:00
Sam Rawlins dbb56e5e10 Connect g/setters which override fields (w/ implicit g/setters)
Change-Id: I4eeb507e23962fbf53f1026e14f4e2ae607aa7e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128105
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-12-12 01:44:43 +00:00
Sam Rawlins 1aeff32c14 NNBD migrator: record type information in TypeName type arguments
This prevents the following crash:

Bad state: Missing declarated type annotation in /home/test/lib/test.dart; for Object
  package:nnbd_migration/src/variables.dart 68:7                      Variables.decoratedTypeAnnotation
  package:nnbd_migration/src/edge_builder.dart 1378:26                EdgeBuilder.visitTypeName
  package:analyzer/src/dart/ast/ast.dart 10012:49                     TypeNameImpl.accept
  package:nnbd_migration/src/edge_builder.dart 844:10                 EdgeBuilder.visitIsExpression
  package:analyzer/src/dart/ast/ast.dart 6372:49                      IsExpressionImpl.accept

Change-Id: I23ed49ccbd3625d9f9fbc7e07a69be3c580896ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127457
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-12-09 20:50:23 +00:00
Sam Rawlins 991e55f6ad NNBD Migrator: Fix generic super initializers
Change-Id: Icc78a248791881a97f5221ee2b5edf6314266225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127542
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-12-09 19:53:11 +00:00
Sam Rawlins 41d8b9ee63 NNBD Migrator: Handle super redirecting initializers
Change-Id: I52043caaad81a89fe12cc554c32d1b0943d37b27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127420
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-12-05 22:59:50 +00:00
Sam Rawlins 7ac3f3e904 NNBD migrator: Visit metadata on top-level functions
Change-Id: I6825f03ca754e05a6a8a7d4a9d3c13d9baa5ddaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127400
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-12-05 22:13:49 +00:00
Mike Fairhurst dc3af706e9 [nnbd_migration] assume non-nullability in is check
This fixes the problem with inferring E? in package:typed_data.

Change-Id: I376204e3f82f0d6054a2c78b502fd240db48798d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-11-26 22:37:20 +00:00
Mike Fairhurst 0019bf646b [migration] handle side casts, assume non-null with const guard.
Fixes the only exception package:typed_data!

Change-Id: I130fe63d7e31019ad38a30a681505e88822af443
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126087
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-11-25 21:28:55 +00:00
Konstantin Shcheglov 6294c73f3e Deprecate 'typeSystem' parameter for InheritanceManager3.
Change-Id: If14eb8900b0fb5cac5e49cf865f2e6e3a0a0263d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-22 23:08:41 +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
Konstantin Shcheglov f3455278ff Use 'isNonNullableByDefault' flag in TypeProviderImpl.
Instead of giving it the NullabilitySuffix, for consistency with
TypeSystemImpl.

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

Change-Id: I16d1ca32071b8a28a31e207afed604f8d4b24a2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 21:43:56 +00:00
Konstantin Shcheglov dcaf959589 Fix several unused elements, and unnecessary casts.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I81559cb241c0ca6918f6730538f44a7411907867
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125986
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 21:37:52 +00:00
Sam Rawlins 535cbf5db9 NNBD preview: Text for return type with nullable return type in subclass
Change-Id: Ia829b3f8cb7f09b10180478394608a05cdcdbb6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125984
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-11-21 21:07:25 +00:00
Paul Berry 1fb118f0e7 Migration: do not call FlowAnalysis.finish from inside a finally block
FlowAnalysis.finish checks the proper nesting of begin/end calls to
flow analysis, but such nesting might not hold in the presence of
exceptions.  As a result, if we call FlowAnalysis.finish from inside a
finally block, we may report an error due to the lack of proper
nesting, and lose the original cause of the exception.

In these exceptional circumstances, it is better to allow the original
cause of the exception to propagate to error reporting, since its
stacktrace will be closest to the site of the bug, rather than to have
it replaced by the error from finish().

Change-Id: I58b1bd4882362ff1e23c03dc8ba65e39655fc98f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 18:59:05 +00:00
Paul Berry 6fa41ae6f9 Migration: remove _notNull* fields from EdgeBuilder.
We want to create a separate nullability node for each non-nullable
node so that instrumentation can explain to the user where it came
from.

Change-Id: Id51a3366284e8c51c466458c1c14de963cd0bd05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125551
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-21 15:19:15 +00:00
Konstantin Shcheglov 615928c514 Stop referencing non-API TypeSystem in analyzer.
Replace it with TypeSystem from lib/dart/element/type_system.dart,
or (internally) with TypeSystemImpl.

We keep the old TypeSystem where its is exposed from API:
- ResolveResult.typeSystem
- AnalysisSession.typeSystem
- AnalysisContext.typeSystem

  We will make changes to these as a breaking change later.

Change-Id: I40ca53ea77e440457c6d0f3832ec3b6286bacdf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125770
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 01:09:24 +00:00
Paul Berry 4ce204d16a Migration: remove unused variable
Change-Id: I0c699bc8723a6eda395b5bf787aca91bd9f7004f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125769
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-20 23:04:22 +00:00
Paul Berry 97e432a5bc Migration: refactor _checkExpressionNotNull.
Previously this was based on creating a dummy type pointing to `never`
and then trying to assign to it.  Since we are trying to get rid of
explicit references to `never` outside of the graph logic, that isn't
going to work anymore.  Refactor to just create the correct edge
directly using NullabilityGraph.makeNonNullable.

Change-Id: I18683bfe5e02924d2ccfcb0459047568734f975d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-20 23:04:22 +00:00
Sam Rawlins ed971fd0c7 NNBD migrator: Add Locations for each edit made in an NN fix
Change-Id: I53342cb43910deea2f59f37d5795ddbb70cb6b0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125480
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 20:40:25 +00:00
Mike Fairhurst e34e734b56 [nnbd_migration] track causations for substitution nodes
Change-Id: I7da4f2923d9b99b0bd6c16644a7adeaeda437340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125463
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-18 18:49:39 +00:00
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
Mike Fairhurst a6635d006b [nnbd_migration] Show "exact nullability" in output directory.
Change-Id: I29545fe358282aa05dee10ed7ff5e86ea899581e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125222
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-15 18:27:24 +00:00
Paul Berry bd43ef8144 Migration: stop using "never" for the result type of an "is" check
Change-Id: I02b80817e46e0544b38dceb7b8a3f92aebede1d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125229
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-15 02:02:35 +00:00