Commit Graph

4090 Commits

Author SHA1 Message Date
Paul Berry 228df22dbf Remove the old constraint variable based nullability migration logic.
Change-Id: I4fe2836160acf5adfd805a327616880f857e9b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102387
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-13 16:38:01 +00:00
Paul Berry 83607564ea Switch nullability migration over to the new algorithm based on the new nullability graph.
Change-Id: I1cbfba8d3d46020d8e943109e582d61315781561
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102386
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 16:38:01 +00:00
Paul Berry 354bfb5bab Remove a few more usages of NullabilityNode._nullable.
This will allow us to switch to the new nullability migration algorithm.

Change-Id: I0246275aa07243f809fa490fdeb6b729e407c9c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102385
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 16:38:01 +00:00
Paul Berry 933ad32baa Add logic to assertNonNullIntent to check the nullability graph.
This will be necessary to avoid losing test coverage when we remove
the old constraint-variable based migration algorithm.

Change-Id: Ie0c29e681f92044d11be6acdeeed1a16c806960a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-13 15:52:31 +00:00
Paul Berry b05190499d Add new nullability propagation logic based on the NullabilityGraph.
For now, we verify that the new logic produces the same results as the
old logic.  In follow-up CLs, the old nullability propagation logic
will be removed.

Change-Id: I2004067093e1f5a5cdf51786ed409058707c4a49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-13 15:43:40 +00:00
Paul Berry f3aca11478 Record not-supplied named parameters in the nullability graph
Change-Id: Ie9656b6de3e1545f9021e7d1d8d6747c51f1e342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:43:40 +00:00
Paul Berry 2fbc446d23 Record information about guards in the nullability graph.
Change-Id: I169133b85e0405d1ff6b3384a6d99c7fcb33a0fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:43:40 +00:00
Paul Berry 0ce9cb7267 Encode unconditional control flow information in nullability graph.
Change-Id: I598e05b61d6639d72ae6f84ab48f4e4051c87014
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:43:40 +00:00
Paul Berry 8a8a700336 Fix nullability of inferred dynamic types
Change-Id: Ib27c5ade4a57bbfa73c528adbafaaa19be53c97c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:43:40 +00:00
Paul Berry 9bbc06fddb Add the ability to do a debug dump of a nullability graph.
Change-Id: Ia3536423349ded8810c06ef2d4a631607273af88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:43:40 +00:00
Danny Tuppeny a779db0813 Update LSP spec to latest
Change-Id: I6f7ff3c6707f992aa618ad172e81857153b75795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102360
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:11:15 +00:00
Danny Tuppeny b7521f5e1b Fix lints not appearing when using LSP Server
Change-Id: Ib3b4396a611be32b91b08d68c962302899a1ad88
Bug: https://github.com/dart-lang/sdk/issues/36931
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-13 15:03:30 +00:00
Danny Tuppeny 9472745446 Change error code for server shutting down
See https://github.com/Microsoft/language-server-protocol/issues/684#issuecomment-477215334.

Change-Id: I9e45dd27ea914af8bc3b936e9885c113211c50ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-13 15:03:11 +00:00
Danny Tuppeny f7e288e3ad Return empty responses instead of errors for non-Dart files in LSP server
Previously we could return "invalid path" responses for any non-Dart files. This allows clients to send requests for other files and just successful (though empty) responses.

Change-Id: I192e83ac2ebd2124c03c22e3e048a066cfd33f17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101990
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-13 09:04:36 +00:00
Konstantin Shcheglov 6dd7007b48 Tweak CONVERT_TO_PACKAGE_IMPORT assist.
There were a (probably very rare) case of invalid URI issue.
I also renamed the ID and method to be consistent with the message.

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

Change-Id: Ie97b1f81c78b67565d7831d532b7a28800db41a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102246
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-12 18:08:47 +00:00
Paul Berry b8050f9322 Make NullabilityNode.nullable private.
This will help ensure that we don't accidentally make more use of it
before removing the constraint variable migration implementation
entirely.

Change-Id: I6cd898d1a3b2f2a4e9df9ea22c17ca77d3119567
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-10 22:07:08 +00:00
Paul Berry d47c31da48 Remove NullabilityNode.isNeverNullable.
This method relied on querying the underlying constraint variable, so
it needed to go in order to migrate away from the contraint variable
implementation.

Change-Id: I73f4b435d3ab4127cd0a08eaf96e8f15c1591430
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-10 22:06:58 +00:00
Danny Tuppeny be6bbfc06b Remove redundant error notifications from LSP server
Change-Id: Ie2b4ac3c348835ad817cb34f24cc9b4108f1076d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101989
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-09 18:09:31 +00:00
Danny Tuppeny 4c2b9f1d91 Don't send LSP error notifications for files in dot-folders
Fixes https://github.com/dart-lang/sdk/issues/33778.

Change-Id: I721ef96a6c137495dc5bfba2ccce16acd7f5be35
Bug: https://github.com/dart-lang/sdk/issues/33778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-09 14:44:23 +00:00
Danny Tuppeny 0450462503 Improve sending/flushing of errors for files in dot folders
Ensure errors are only sent when there is an appropriate time to flush
them (plus ensure if of those places flushes them).

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

Change-Id: Ieb4a2631c24649ba013eda93808b003b0e2ddb95
Bug: https://github.com/dart-lang/sdk/issues/33778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-09 14:44:23 +00:00
Jaime Wren 454b98c490 Some additional tests in variable_name_contributor_test.dart to cover all the doIncludePrivateVersion cases
Change-Id: I8ec2a14e8ba4cc3a1ca4228c5455ab7cb6a2138c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101924
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-05-08 23:10:49 +00:00
Paul Berry 51fe641e82 Create a SynchronousSession class.
In the long term this class will take over much of the role played by
RestrictedAnalysisContext.  For now it is simply a container for the
analysis options, declared variables, type provider, and type system.

In follow-up CLs I will plumb this object through various parts of the
analyzer, especially the LinterContext; this will enable the
canBeConst... methods to be moved into SynchronousSession, and that
will allow us to stop creating a LinterContext in
BestPracticesVerifier.

Change-Id: I7ac2d386c10d2e5339d9715848b185c163e1f858
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-08 19:57:31 +00:00
Paul Berry 7e58fb155a Sort declarations in fix_lint_task.dart
Change-Id: I2053afe2ebf05b5ff10de72757fc83ffc81d1590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101862
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-08 19:05:51 +00:00
Devon Carew ab84e36989 [dartfix] refactor the dartfix cli UI a bit
Change-Id: I9935ace979b0302d4f68c8a84ed9886a0ccf0c4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101761
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-05-08 18:51:11 +00:00
Brian Wilkerson f7bf890ff7 Improve the convert-to-package-uri assist
Change-Id: I2010d33b740932569e6fcafcc15fde30a96cf0df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101743
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-08 16:01:55 +00:00
Brian Wilkerson f80f0bfcfd Reland "Implement the type Never"
This reverts commit 78e50a5f9b.

Change-Id: I2ec4cdcfda4a6d199308a3b25a2ed0792e9d9a26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101621
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-08 13:26:45 +00:00
Jaime Wren 8de23bbbff Update the Dart Analaysis Server protocol to 1.26.1 to mark that the MOVE_FILE refactoring is now enabled. The functionality landed May 3rd, 2019 with https://dart-review.googlesource.com/c/sdk/+/101320
Change-Id: I7f33b73304a72db1375a6a21132dc8207cc784c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101630
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-07 22:15:56 +00:00
Paul Berry ca4b63f067 Remove NullabilityNode.isAlwaysNullable.
This method relied on querying the underlying constraint variable, so
it needed to go in order to migrate away from the contraint variable
implementation.

Change-Id: I0c5004f98fcbb1891ade67266350569a196cf756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-07 21:11:42 +00:00
Paul Berry df7db795dc Stop using ConstraintVariable.always to represent the nullability of dynamic.
This is a necessary part of reworking nullability migration to stop
using constraint variables entirely.

Change-Id: If6c347c16882edfc2e8bdbeac761e09d8256c9bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-07 20:15:18 +00:00
Paul Berry d06c7b7c89 Remove the ability of migration to use ?s in input files as a hint.
This speculative feature turned out to be infeasible, since the files
that are input to migration have NNBD disabled, so `?` is not
permitted.

Change-Id: Ice3fabe436c25718cbe4099a4d9ef86c8aa19896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-07 20:14:08 +00:00
Jaime Wren 2ee973102c Add some additional tests for variable name completions for variable naming inside of for-statements
Change-Id: Ifbc06485a7378f917770ec41e8f0f602bbc2bd1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101624
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-07 20:06:55 +00:00
Paul Berry 2c3114f7a7 Replace most uses of assertConstraint with assertConnection.
This helps reduce the use of constraint variables in nullability
migration tests.

Change-Id: I48fb540489b1124f278b542a7f847c4dd3270185
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101465
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-07 19:55:28 +00:00
Paul Berry 5b63d74608 Rework some migration tests to make use of the nullability graph.
This required tracking the map from a node to the nodes that are
upstream from it.

Change-Id: I079fac2196f3928b521b0866fd6f1790e6f24573
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101489
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-07 18:34:57 +00:00
Brian Wilkerson 78e50a5f9b Revert "Implement the type Never"
This reverts commit 40a06c3a77.

Reason for revert: Introduced a bug that is blocking a roll.

Original change's description:
> 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>

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

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

Change-Id: Iebb5b8327b0be7129298f39b343555b812314abf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-07 16:22:37 +00:00
Paul Berry 078338bb1d Create a data structure to track the graph of nullability nodes.
The previous design (which stored the graph impicitly in the nodes
themselves) had a memory leak because some nullability nodes are
static, meaning that once a node became connected to one of the static
nodes, it would never be garbage collected.

Change-Id: I9821660198e29ff974ee0afa678851e0418e0527
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101487
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-06 21:48:02 +00:00
Konstantin Shcheglov 8d1ed856d2 Always create DeclarationsTracker in AnalysisServer.
R=brianwilkerson@google.com

Change-Id: I1de49423d921da1fdf78ecd480a26e4577efcfe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-06 18:56:13 +00:00
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 58ef1db2ba Enable the MOVE_FILE refactoring in the Analysis Server edit_domain.dart
Change-Id: I8859c6aa4144f4b5328c23a22b78e400706668c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Danny Tuppeny <dantup@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-05-03 17:19:14 +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
Konstantin Shcheglov 158a52ee3f Change the message for FLUTTER_REMOVE_WIDGET.
R=brianwilkerson@google.com

Bug: https://github.com/Dart-Code/Dart-Code/issues/1647
Change-Id: I6061e3432c267dad550e57789aea522cc8fb2d87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-02 17:00:53 +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