Commit Graph

2889 Commits

Author SHA1 Message Date
Jaime Wren f6ba1abab1 Additional MOVE_FILE bazel tests that cannot yet be run due to the expectations around analysis roots and the refactoring test framework.
Change-Id: Idea9b52a7e1be39750cdfa4b40e2e0d5756e20fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101442
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-06 18:11:42 +00:00
Jaime Wren ff0f2a6b2e Refactoring renaming of some tests in move_file_test.dart and sorting of the tests
Change-Id: I14d132c070b866da0a1373fc0f807f868f3024a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101078
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
2019-05-02 21:40:24 +00:00
Jaime Wren 4a31d8b62b Additional tests in move_file_test.dart - the analysis server tests for the MOVE_FILE refactoring.
Change-Id: Icddbdf0da237b43af2513ec2407ec774218360f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101068
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 19:56:51 +00:00
Brian Wilkerson 5bac4d9b0c Reland "Add support for recording context information with analysis errors, with one example"
This reverts commit b9bf239c65.

Reason for revert: The angular and angular plugins have been updated so as to make this safe.

Original change's description:
> Revert "Add support for recording context information with analysis errors, with one example"
> 
> This reverts commit 6114435ea5.
> 
> Reason for revert: Broke angular and angular_analyzer_plugin
> 
> Original change's description:
> > Add support for recording context information with analysis errors, with one example
> > 
> > Change-Id: Iba1c48163ce264d85a68bcb9f70e5025a7cdbfbb
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100563
> > Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> > Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> 
> TBR=scheglov@google.com,brianwilkerson@google.com
> 
> Change-Id: I275c6e4473de73199ea9b5e490379ba58aec1d43
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100628
> Reviewed-by: Paul Berry <paulberry@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ib1b7e63a459e63bcbf02f26bcf167ddad45295b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 17:07:03 +00:00
Brian Wilkerson 40a06c3a77 Implement the type Never
Change-Id: Icbf407bc19f602c8382946b1e735905cc165c59c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100993
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-02 16:31:23 +00:00
Paul Berry fa274ec059 Make each NullabilityNode track those nodes that are downstream of it.
This allows more migration tool unit tests to be simplified so that
they don't have to refer to ConstraintVariable objects directly
anymore.

In order to make this work, a few other changes were also necessary:

- Make a derived class for NullabilityNodes that arise from
  conditional expressions.

- Add a getter to reveal whether a NullabilityNode is known a priori
  to be non-nullable.

Change-Id: I8a68b627ce9e807a50d371369985f52848903a2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-01 12:42:14 +00:00
Brian Wilkerson 9670b2ccb9 Update the server API to support context messages
Change-Id: Ic07ef7d01125ca76f72e8c0e370181ea4f6f7cb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100825
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2019-05-01 01:31:44 +00:00
Paul Berry af1dbdf13b Change representation of ExpressionChecks.
Previously, this class held on to a ConstraintVariable indicating
whether a null check should be inserted.  Now it holds on to
NullabilityNodes indicating whether the source and destination of an
assignment are nullable, and it can infer from this whether a null
check needs to be inserted.

This paves the way for removing the old constraint solving logic in
favor of a more direct nullability propagation approach using
nullability nodes.

Change-Id: I96b95c400ed40bd12f9c9dcbb4c09a69849e51c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100885
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-30 17:21:20 +00:00
Jaime Wren a7325f9e59 Re-enable and fix the move_file_test.dart tests in the analysis server.
Change-Id: I633ea597dc5ed4540eda119766e9390cba0152ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100786
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-04-30 16:16:08 +00:00
Dan Rubel 4215dc8365 cleanup analyzer warnings
Change-Id: Ia5282ebb910babc47f9e2012bb5a5bc616846568
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100881
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-30 15:56:08 +00:00
Paul Berry 9cf5e51988 Consolidate test usage of ExpressionChecks.nullCheck into a single method.
This should make it easier to refactor the migration logic without
having to change tests too much.

Note that there is a minor loss of test coverage: in
test_functionInvocation_parameter_fromLocalParameter, we no longer
verify that non-null intent is sufficent to force a check to occur.
This is ok, because in future CLs, we will be simplifying the logic
for deciding when to add null checks so that it occurs precisely when
it's necessary to avoid a type mismatch.  Once that change has been
made, the correct behavior with non-null intent will happen
automatically.

Change-Id: I087c5c800fae3defa5b68380f05da40700af1359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100793
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-30 12:50:38 +00:00
Brian Wilkerson 2f06696655 Include the keyword required when printing elements, with additional cleanup
Change-Id: If252711ece4ed92bb52b9285704d91944a482c4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 17:51:50 +00:00
Paul Berry e2d0f5a50b Add featureSet parameter to Parser constructor.
And deprecate old parser configuration setters.

Change-Id: Ib1507b8d2b20be7c883061e2a92ec9205d6a378f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100664
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 16:42:19 +00:00
Konstantin Shcheglov fd76dda221 Identify mobile or web Flutter correctly when both are possible.
R=brianwilkerson@google.com

Bug: https://buganizer.corp.google.com/issues/131257401
Change-Id: Ifccb54504e7551009cdc3a66dd454e653d3cdd4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100663
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-27 16:52:56 +00:00
Jaime Wren 5964ec4db7 Disable all tests in move_file_test.dart by renaming the file to move_file_disabled.dart
Change-Id: I18b044eb896cfb4c0f26211541a93ea4587b0a88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100634
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
2019-04-26 22:58:04 +00:00
Brian Wilkerson d03323783a Fix an exception in flutter outline when using ui-as-code elements (issue 36772)
Change-Id: If0cb8972cc172581d0365e4d9e0bab0cfee598c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100629
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-26 19:26:55 +00:00
Jaime Wren c46deebfb6 Disable all the analysis server move_file_test refactoring tests
https://ci.chromium.org/p/dart/builders/ci.sandbox/analyzer-win-release/5285

Change-Id: I3593963625ecc9fb35182e7666d98be26f785e04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100662
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
2019-04-26 18:28:35 +00:00
Paul Berry b9bf239c65 Revert "Add support for recording context information with analysis errors, with one example"
This reverts commit 6114435ea5.

Reason for revert: Broke angular and angular_analyzer_plugin

Original change's description:
> Add support for recording context information with analysis errors, with one example
> 
> Change-Id: Iba1c48163ce264d85a68bcb9f70e5025a7cdbfbb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100563
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: I275c6e4473de73199ea9b5e490379ba58aec1d43
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100628
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-26 18:03:57 +00:00
Jaime Wren 6c3a91f281 Take 2 on getting the analyzer bot fixed
Change-Id: Iba56a29069672aa469328308b2ffcc189ded5d05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100660
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
2019-04-26 16:18:49 +00:00
Devon Carew 14d09498b7 [analyzer] don't traverse into dot folders when analyzing android manifest files
Change-Id: Ic0797064bc4209c597afb080adc050bf4a4c1f2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100569
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-04-26 15:14:39 +00:00
Jaime Wren 8c03636b75 Windows analyzer bot fix- normalize file paths that are resolved in memory
Change-Id: I29fa246e86afa7a56fc97e1662db765a120ad19c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100564
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-04-25 21:17:22 +00:00
Brian Wilkerson 6114435ea5 Add support for recording context information with analysis errors, with one example
Change-Id: Iba1c48163ce264d85a68bcb9f70e5025a7cdbfbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100563
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-25 18:41:23 +00:00
Brian Wilkerson 6498a3e357 Add some tests of the listTokenDetails request
Change-Id: I5dc2ae390777454128f18bef95bb00dcbce18f66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-25 18:41:14 +00:00
Brian Wilkerson 000a3eb3f7 Add completion support for late and required
Change-Id: I418aaa3aea9e6da6bcaf02e00c7e329e91175bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100467
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-25 13:24:50 +00:00
Jaime Wren efd1ccb31a Modify the MOVE_FILE refactoring support to be passed a resolved unit like other refactorings.
Change-Id: Ia9d8ced49f3cad6974aca57de64121686d8c48e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100320
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-24 15:58:46 +00:00
Brian Wilkerson 43e26c2de9 Add highlight support for late and required
Change-Id: Ic57ab28c3cbe600f9733733d96d367e774504b97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100323
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-24 13:22:26 +00:00
Brian Wilkerson b4d17f2eee Add diagnostics related to default values
Change-Id: I4b30580e34fbf302a53778010fada54a2e100409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99887
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-23 17:16:50 +00:00
Paul Berry cee1e41fe8 Plumb new FeatureSet class into Scanner.
And change clients of the scanner (within the SDK) to use it.

Long term, it would be better to store the FeatureSet object directly
in the Scanner and remove the existing flags `enableGtGt` and
`enableNonNullable`.  However there are analyzer clients that
currently use these flags.  So for now, we simply plumb in the
FeatureSet as a new way of setting AstBuilder flags.  Once we've
updated clients to use FeatureSet, we'll publish a breaking version of
the analyzer that removes the old flag API.

Change-Id: I9e662f4ed45668d9acd4f56e42d7d8dae6180d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99975
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-23 16:13:43 +00:00
Keerti Parthasarathy 1f1592edce Add manifest checks for touchscreen feature
Change-Id: Ib849eccdbad6f41e22dbffeca755099cb3926f8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100160
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-23 00:32:54 +00:00
Brian Wilkerson 32f5223119 Search all directories when attempting to analyze manifest files
Change-Id: I3a900362d8d36d27e5c22f600db7bc54059c7717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99401
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-16 00:45:32 +00:00
Brian Wilkerson 6c5709c44a Remove the URI of types until we can produce better URIs
Change-Id: I50e4361b2736245d8d1af32da15822e416c5b2be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99267
Reviewed-by: Ari Aye <ariaye@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-12 19:18:01 +00:00
Brian Wilkerson 850d56c681 Fix an error in the manifest file test framework
Change-Id: Id0aff93f9312a510a7ef375dc6087e971aa0189c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99203
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-11 19:53:31 +00:00
Konstantin Shcheglov d4fee0a85e Issue 36576. Add returnType to constructor in available declarations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/36576
Change-Id: I6acbf82bbaafc1ab5a1599cd415cdb11600064a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-11 18:59:43 +00:00
Brian Wilkerson a9f8248bfb Add support for computing fixes in pubspec and manifest files
Change-Id: Ib13f7a529a441cf02d91452ac7507fffdee06161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99091
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-11 13:23:54 +00:00
Brian Wilkerson 17f5d2d757 Add assists to inline add and addAll
Change-Id: Ie085fd10ffe533fae8a0c5f6325d081a118adc39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99040
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-10 20:40:33 +00:00
Brian Wilkerson 5735bde143 Fix a test to fix the windows bot
Change-Id: Ifcf60eda337a8dea149fb9c9eeec9efca477e885
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-10 17:16:16 +00:00
Brian Wilkerson 523e3789e0 Add support for providing fixes in analysis options files
Change-Id: I6c9a0a0624201538a90608c2eff9cff7b6cdb4b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98870
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-10 03:39:40 +00:00
Ben Konyi 15b11b0183 [ VM / Service / Observatory ] The VM service now requires an authentication code by default.
Previously, a valid web socket connection would use the following URI:

`ws://127.0.0.1/ws`

Now, by default, the VM service requires a connection to be made with a
URI similar to the following:

`ws://127.0.0.1:8181/Ug_U0QVsqFs=/ws`

where `Ug_U0QVsqFs` is an authentication code generated and shared by the
service.

This behavior can be disabled with the `--disable-service-auth-codes`
flag.

Change-Id: I288aac58e3ba9d35dca8071f3f7e7a073896c271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98433
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-04-09 22:57:29 +00:00
pq 01967b68d7 fix convert_to_spread assist to work on empty lists
Noteworthy that this issue was flagged by an attempt to convert flutter (https://github.com/flutter/flutter/pull/30784).  Specifically, the assist here was throw a Bad Element exception:

  set fakeResults(Map<String, List<ProcessResult>> value) {
    _fakeResults = <String, List<ProcessResult>>{};
    for (String key in value.keys) {
      _fakeResults[key] = <ProcessResult>[]
        ..addAll(value[key] ?? <ProcessResult>[ProcessResult(0, 0, '', '')]);
    }
  }








Change-Id: Icec80f14160cf9ba28a4e8e39935f469e762b39f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98985
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-04-09 22:06:07 +00:00
Paul Berry 27ef571e5b Encapsulate more uses of NullabilityNode.nullability inside the NullabilityNode class.
This CL adds the following new members to NullabilityNode:

- A `debugSuffix` getter, to retrieve a string representation of a
  nullability node for debugging test failures.

- An `isAlwaysNullable` getter, to determine whether a NullabilityNode
  is known, by construction, to always be nullable.

- An `isNullable` getter, to determine whether constraint solving
  assigned the nullability node to be nullable.

With these new members, the two constraint variables inside the
NullabilityNode class (`nullabile` and `_nonNullIntent`) are only
referred to from within the NullabilityNode class itself, and in
tests.

Change-Id: I0f51aa2834a885fb13c6bbfe7d68cd517b65724a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-09 21:31:07 +00:00
pq 30b1326b1f allow if element conversion assist to work on conditional sub-nodes
Change-Id: Ic4e7e5cf80a5158c456c808134a0dd3706ff1385
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98981
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-04-09 20:31:37 +00:00
Paul Berry 7f224d9fbe Track parameters that might need to be made optional/required using NullabilityNode.
Change-Id: Ibcd1aaadb9ffe16c7b7f1c3a0298c7abf2fc0c34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-09 18:30:07 +00:00
Paul Berry 6c063512ae Validate that nullability is propagated from optional/required named parameters.
The code that accomplishes this is non-obvious (it relies on the fact
that we use the same constraint variable to track the nullability of
such parameters as to track their optional-ness), so it's worth having
specific tests for.

Change-Id: Ia2ccfca6ffe3f8050f14b3849e80a0e721cc143f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-09 18:30:07 +00:00
Paul Berry ed7f524afb Refactor more of the migration tool to use NullabilityNode rather than ConstraintVariable.
With this CL, the NullabilityNode class is now used for the following
purposes:

- In ConditionalDiscard, to keep track of when branches of "if"
  statements should be discarded.

- To track the nullability relationships implied by an assignment.

- To track the nullability implied by an optional parameter that lacks
  a default value.

- In _ConditionInfo, to keep track of how assert statements imply
  non-null intent.

Change-Id: Ieb05bb569258a3d16720c127a3f6038f805304c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-09 18:30:07 +00:00
Brian Wilkerson 43f301ccec Add a fix for the prefer-is-empty lint (linter issue 1504)
Change-Id: I4c13b6c7d233440fc73a2db35559c5526212e045
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-09 12:45:48 +00:00
Brian Wilkerson fb630ea246 Split an AssistKind to provide a better message
Change-Id: I75068e9d5fde21df89c999f845bc135813ea18ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98906
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-08 23:51:09 +00:00
pq cc63d6e647 dart fix support for control_flow_collection fixes
Change-Id: I1cd2dccfcc5b5687934e98ea704184c4bb6a50a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98866
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-04-08 21:48:29 +00:00
Paul Berry b2df6eddda Make a new "nullability node" abstraction for the migration tool.
I will follow up with CLs that re-express the nullability inference
rules in terms of nullability nodes rather than constraint variables.

Change-Id: I6d8492eb83d09dde665ec925d0ac0fde19a3c521
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-08 16:41:23 +00:00
pq cf04a16527 dartfix to migrate to spread collections
Change-Id: I7764f29e159356cc589f4e66b80eefff6cc998f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98742
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-04-05 22:27:58 +00:00
Konstantin Shcheglov ca4e707e80 Fix AvailableSuggestionSetsTest on Windows.
R=brianwilkerson@google.com

Change-Id: I99fb2c60e539b0acc37bcb2073c1624a620ddff5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-05 19:21:11 +00:00