Commit Graph

3010 Commits

Author SHA1 Message Date
Konstantin Shcheglov cfdcfe2bfe Update DeclarationsTracker when a context options change.
E.g. when .packages changes, we want to re-scan the context for new
available libraries. We also don't want to discard all context, and
resend everything.

R=brianwilkerson@google.com

Bug: https://github.com/Dart-Code/Dart-Code/issues/1723
Change-Id: I19ee71c1d021fb9bcda9d02d86b7cbb078704aa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-21 18:43:36 +00:00
Konstantin Shcheglov 181685b852 Allow disabling individual server features.
Change-Id: I4d06eaf76300c6784b88bd64ad322c306a276488
Bug: https://github.com/dart-lang/sdk/issues/36881
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103182
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-21 18:40:26 +00:00
Danny Tuppeny 88f139db68 Fix NPEs when processing unknown kinds in LSP
Fixes https://github.com/dart-lang/sdk/issues/37016.

Change-Id: I72eae50a03bb2c73678b65a07e6924a2a53d137e
Bug: https://github.com/dart-lang/sdk/issues/37016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103131
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-21 13:30:10 +00:00
Danny Tuppeny 022adc5bc3 Implement using suggestion sets for LSP completions
Change-Id: I66d725c09492040be5e621d80270b12a21bb8192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102704
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny 0f24e4b277 Wire up LSP completion resolution provider + sendWorkspaceEdit command
Change-Id: I424b4d9bbc64f6fea7a4d9b06e2180b3fbd21f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny 7be23977f1 Minor LSP tweaks in preperation for included suggestionSets
Change-Id: I9dff56139754b8a182e906d64dd0bcc009c4b6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Paul Berry 42334a7f67 Infer when the bound of a type parameter needs to be nullable.
Change-Id: I6c500318a66e05a0b3d10c85f07660dfe37339ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-17 20:41:11 +00:00
Danny Tuppeny 8209013be3 Fix DartDoc section in Diagnostics server for LSP
Change-Id: I8bb40a08b7b6aa53c962bc5a86eb3e68a330a87c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-16 13:34:47 +00:00
Danny Tuppeny 6805bb52ea Add implementation/tests for textDocument/Implementation
Fixes https://github.com/dart-lang/sdk/issues/36896

Change-Id: Ie450c6c5257ac13aa3c7b48343aa8b015b1dc4d8

Tweak tests to require all, plus fix empty classes

Change-Id: Iefff7e24c6b965f0a1bc5abf8adbac26ad38e3a0

Add implementation/tests for textDocument/Implementation

Change-Id: I640379d83aeb9baa73d04d98d39147e2b748d6c3
Bug: https://github.com/dart-lang/sdk/issues/36896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102366
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-15 09:08:28 +00:00
Danny Tuppeny 3a7ce7a646 Enable declarations tracker for LSP to support dart doc macros
Change-Id: I614be91ecf7a1afc377afeee70e559cff324dc61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102368
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-15 08:16:18 +00:00
Danny Tuppeny cdcc387084 Add LSP custom notifications for analyzing status
Change-Id: I0d26d274c9ccc472da81e45d0c9170104bbd9414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102370
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-15 06:35:48 +00:00
Paul Berry f440f77dd3 Store the nullability graph in the nullability nodes rather than in maps.
This should improve performance by avoiding map lookups.

Change-Id: Ic22a4be7486be1b8e9c164e9133c81a4851146a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-13 22:31:44 +00:00
Paul Berry 3ecb89ba8c Move NullabilityGraph into nullability_node.dart.
This will allow NullabilityGraph and NullabilityNode to have shared
access to private data without having to expose it to all other
libraries.

Change-Id: Idbef9a60cdeb273cd5739c45d501370d89b653df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102403
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-13 22:31:44 +00:00
Paul Berry 6080e546c9 Rearrange NullabilityNode class hierarchy.
Instead of making immutable nullability nodes derive from mutable ones
(forcing the mutation method to be overridden to thrown an exception),
we make sibling classes for mutable and immutable nodes.  This will
allow additional mutation methods to be added in a less kludgy way.

Change-Id: Ib147583e0a9c4b56333ad9c56c3c725f02ab19ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102402
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-13 22:31:44 +00:00
Paul Berry bed74d6e97 Remove NullabilityGraph._upstream.
Its only purpose was to make NullabilityGraph.getUpstreamNodes fast to
compute, but that function was only used in unit tests anyway so there
was no need for it to be fast.  (Minor exception: it was also used in
an assert statement, but I was able to change that to
Nullabilitygraph.getUnconditionalUpstreamNodes).

Change-Id: I8be18560c2f454908eb0e31d198fd22961a89278
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102388
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-13 19:23:51 +00:00
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 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
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
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
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
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 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
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
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
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
Dan Rubel 49573f59d3 cleanup analyzer warnings
Change-Id: Ieb2fd5e64efe7dbd7da70b4ee2f723d0fd5243ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-29 17:50:26 +00:00