Commit Graph

4090 Commits

Author SHA1 Message Date
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
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
Brian Wilkerson 3d0825da5d Improve the message when a mixin cannot be applied because the superclass does not implement a required class (issue 36775)
Change-Id: Ifdcf8de365dbdcb50aa70acc8552a302ef2c8e1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100700
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-29 15:13:49 +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
Jaime Wren 688f029c4f Rename workspace to refactoringWorkspace in move_file.dart to clarify the type of the object.
Change-Id: Idfe7c53cfbdab59d7343c449f01c1ab4c57160db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100266
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-23 17:40:42 +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
Paul Berry 38eed58f61 Fix hints in nullability migration code
Change-Id: I22ef26cd928832a9d9ab2e8f4552519b914eef98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100080
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-22 14:00:59 +00:00
Brian Wilkerson af0fa108da Add support for required named parameters
Change-Id: Iebfd8da18c6f2158ed39043ab116e2670a7329c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99717
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-19 19:25:01 +00:00
Konstantin Shcheglov e6e2a196a3 Issue 36667. Check for unresolved URI in getLibraryByUri().
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/36667
Change-Id: If35719b350c2f26edbb7cbe42f51af896aa41fe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99713
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-18 18:02:38 +00:00
Konstantin Shcheglov 92729e0cd3 Remove UndefinedTypeImpl.
And corresponding DartType.isUndefined as well.

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

Change-Id: I85debe627e989b5a5671becf5d9dd16413562236
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99729
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-18 17:42:28 +00:00
Devon Carew cf77b82f52 [analyzer] handle youtube and animation dartdoc directives
Change-Id: I5bcad74803da2466c8a50160823c586f57e00ec1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99711
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-04-18 17:18:28 +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
Jaime Wren f8c1cc7c24 Update the output for the generated Outline.java to compile. Outline.java has a special fromJson() method special cased in codegen_java_types.dart that was not updated when fields were added to the protocol.
Change-Id: Ib78f8a81ea3b48d6ae821d89617d3c1b66e69fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99375
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-04-15 23:05:56 +00:00
Jaime Wren 067293b7fc Update the copyright year to 2019 before pushing DAS 1.26.0 version to the Dart plugin
Change-Id: I8a2e5de067d5ee5a1bd564e5738e990bf289e325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99372
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-04-15 21:41:29 +00:00
Paul Berry 79974bb026 Rename Nullability enum to avoid confusion with spec.
The spec uses the terminology "nullable", "non-nullable", etc. to
refer to properties of types that differ subtly from their structure.
For example "Null" is considered nullable, even though it lacks a
trailing "?".  Since we were using the Nullability enum to denote a
purely structural property of types (whether they end in "?", "*", or
neither), this led to confusion.

So to avoid confusion, we rename the Nullability enum, and its
enumerated values, to clarify that it refers specifically to the
nullability suffixes and not to the property of being
nullable/non-nullable.

Change-Id: Ia34a500a3d2d724d30c66a410140ae11d6512f50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99275
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-15 16:50:14 +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
pq b6f8c717f0 update lint error code associations
Change-Id: I2918958494c3ffebced64de7a398544f72f78b08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99103
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-04-11 00:26:33 +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 1490a90bc1 Track guards using NullabilityNode rather than ConstraintVariable.
Change-Id: Id7825ef3fdd4400d1ff0d00538b7002accaca7b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98980
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-09 19:11:27 +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
Paul Berry e0a82a3c92 Make NullabilityNode.nonNullIntent read-only
Change-Id: I803a1667d39c6e3c091d248ba8d3bd6fa9918286
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98943
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-09 15:24:43 +00:00
Paul Berry d6e0788ff8 Make constructors for each use case of NullabilityNode.
The old constructor, which simply wrapped a ConstraintVariable, is now
private.

This is another step toward removing ConstraintVariables from the
migration tool entirely.

Change-Id: Ieb4be5b76711aaede5ca56871d52ff3b19c18d70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98941
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-09 14:25:23 +00:00
Paul Berry 564687e2bd Introduce a getter on the Variables class to represent types that are a priori known to be nullable.
Change-Id: I660d02f35233a3ba8b739df8ba7746dfa20f18f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-09 14:25:23 +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