Commit Graph

8489 Commits

Author SHA1 Message Date
Brian Wilkerson 9b8f93b7a1 Ignore text that is not a valid error code in ignore comments (take 2)
I considered doing the bigger refactor I described in the first CL, then
I realized that I can't because the constructors for `ErrorCode` are
`const`. We should still have some kind of tests, but they won't be as
complete as we might hope.

Change-Id: I02f397642a367af2823f67b90ffdca2113fdb8e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192725
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-23 20:22:51 +00:00
Sam Rawlins 6e63b8b8b8 analyzer: ErrorFilterOptionValidator improvements
* error codes are static and final; no need for a public getter
* lint codes are `late final` because they may be registered up until the
  options are validated; the field is lazily calculated at such time.

Change-Id: I8d9c1e9ab4d69be77be49b44f62e605c3f06fd2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-23 20:07:41 +00:00
Sam Rawlins d693078bbf Analyzer: new diagnostic: UNNECESSARY_QUESTION_MARK
`null` is already a valid value of `dynamic` and `Null`, so adding a question
mark to make `dynamic?` or `Null?` is unnecessary, and could lead to confusion.

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

Change-Id: I710ff12935767dd635edfdb026033aa8e27e7804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190041
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-23 19:55:11 +00:00
Konstantin Shcheglov e8d7058f16 Include debug data for state error in ResolvedLibraryResultImpl
Bug: https://github.com/dart-lang/sdk/issues/45430
Change-Id: If1f75ac54dc73fa8b0fe6fc0666acd48b3ff1357
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-23 19:28:01 +00:00
Sam Rawlins 07bb38c8c6 analyzer: Report INVALID_SECTION_FORMAT in 4 more places
* Invalid section (not a Map) under `analyzer: errors:`
* Invalid value (not a Scalar) under `analyzer: errors:`
* Invalid section (not a Map) under `analyzer: strong-mode:`
* Invalid section (not a Map) under `analyzer: optional-checks:`

Change-Id: Iad0b33d312f65af8a995677fe4e57389fea520c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-23 15:20:47 +00:00
Konstantin Shcheglov 90a5a21267 Issue 45411. Remove hasNoSuchMethod check, already done in inheritance manager.
Bug: https://github.com/dart-lang/sdk/issues/45411
Change-Id: I0eda15a0d51164c897a1a6c555b1b1f127fb887e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-22 20:49:45 +00:00
Sam Rawlins bda604e45d analyzer: Remove unnecessary import
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I5c12609a1a139be9d9eee015d593e57c89340d30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192487
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-22 20:33:37 +00:00
Michal Terepeta 6172458220 Trigger checks for generated files also on failed builds
Bug: http://b/183199080
Change-Id: If8a9baed10068f70d24a8831a093e4a4bf240303
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192383
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-03-22 18:14:54 +00:00
Paul Berry dd91769e90 Flow analysis: implement "why not promoted" functionality for arguments.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: Ib39ef04aadc2340c269878763e19a4a97001e2b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191989
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-22 17:31:54 +00:00
Sam Rawlins e267fb2f19 analyzer: Copy triple-shift const evaluation from front_end
Fixes https://github.com/dart-lang/sdk/issues/45374

Change-Id: Id57fa5116e1778dda776fdcf4b45aa0546c093af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192123
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-22 16:33:44 +00:00
Brian Wilkerson 3392632667 Unify three diagnostics for documentation purposes
Change-Id: Id90d4e82d01b59056117c7fc234d8b3a5a8ec7e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192286
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-22 14:44:33 +00:00
Brian Wilkerson 41e00354a3 Unify four diagnostics for documentation purposes
Change-Id: Ifefe90cdbc3ddb9e243a056398b5d8611b3bf22e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192287
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-22 14:43:43 +00:00
Jens Johansen f73b5af4a9 Revert "Ignore text that is not a valid error code in ignore comments"
This reverts commit 9bd1dc6be7.

Reason for revert: Ignoring 'lines_longer_than_80_chars' no longer works, and the CFE bots are purple because of it.

Original change's description:
> Ignore text that is not a valid error code in ignore comments
>
> As per discussions on https://github.com/dart-lang/sdk/issues/35234.
>
> Change-Id: I0e02f646db5328fde5ddc7301c9d76994eb33b4c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192282
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: I24d51b4c0eed6c68b2444bca8388db3c9b4f15a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192302
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-22 08:59:22 +00:00
Konstantin Shcheglov 55b21adf6b Break raw type cycles via GenericFunctionType.
Change-Id: Ia1eb5660bf3085a52f3a449da5a3f88ecb81f0af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-20 23:59:09 +00:00
Brian Wilkerson 9bd1dc6be7 Ignore text that is not a valid error code in ignore comments
As per discussions on https://github.com/dart-lang/sdk/issues/35234.

Change-Id: I0e02f646db5328fde5ddc7301c9d76994eb33b4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192282
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-20 21:16:10 +00:00
Brian Wilkerson 2fc98d71d8 Unify two hint codes for documentation purposes
Change-Id: Ia6f4fe0537e9ef0aa377aa48b624cb357b3d7c1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192283
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-20 19:47:19 +00:00
Konstantin Shcheglov 9fc9088fef Issue 44926. Fix checking generic function type arguments for conforming bounds.
Bug: https://github.com/dart-lang/sdk/issues/44926
Change-Id: I92209fc4839c7d286f5efc5d9deb05e47e6cf017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-20 19:39:09 +00:00
Konstantin Shcheglov 8fd3962363 Fix for accessing CompilationUnitElement.mixins without types.
Bug: b/182750371
Change-Id: I6e15f5f1551b9817eaab503a81597e0d13c77d01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-19 00:27:46 +00:00
Konstantin Shcheglov 2cbb67e5db More tests for resolution and evaluation of metadata.
Change-Id: I4435936d98764650e2f7a278f92e452e3dbfda23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191986
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 21:21:43 +00:00
Sam Rawlins ef7a1cb60f analyzer: Allow excludes list which includes some non-Strings
Remove top-level toStringList yaml utility.

Add related TODOs.

Change-Id: I6da4f70ed4f2823c156edd3ae3b803b581e5d9be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191984
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-18 21:12:03 +00:00
Brian Wilkerson ec04c1f335 Remove some unnecessary ignore comments
Change-Id: Iafa4b9c8aa5dc696c5746248a8701b4f6e875979
TEST=Existing tests.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191980
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-18 19:58:43 +00:00
Paul Berry 847b2b1e11 Move "argument not assignable" checking to ResolverVisitor.
This should make it easier to implement "why not promoted" logic for
arguments, since we'll be reporting the errors at a time when flow
analysis information hasn't been discarded yet.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I8499d711acc88b8397597b6116e5f6cfde43dc53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191805
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-18 19:52:13 +00:00
Paul Berry 681d3e2a43 Allow the expensive parts of "why not promoted" computation to be deferred.
This is necessary because `whyNotPromoted` needs to be called right
after visiting a subexpression, but it's not always possible to tell
that the type of that subexpression will result in an error until more
code has been visited.

Change-Id: If44e2bb55612c1ba7996b523c3ec078d7b80c865
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 19:52:13 +00:00
Michal Terepeta 9933192f36 Move watching generated Bazel files to an isolate
This does a few optimizations to improve the performance of the analyzer
when watching for generated files:

- We do all the polling in a separate isolate.

- We detect when Bazel finished running and only poll afterwards.

- We use a batch interface and deliver all changes at once (instead of
  one by one). This allows us to avoid resetting caches more often than
  necessary.

I had to remove one of the larger tests and created an integration test
instead, since the code for detecting the Bazel builds relies on
`dart:io` directly (`ResourceProvider` does not expose a way to
check for symlink targets).

Since this required a bit more code, I've decided to create a separate
file for it (`bazel_watcher.dart`).

Change-Id: I6c2383e7fd4348ab8af1af639b10db519c7a2f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183010
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 17:50:58 +00:00
Konstantin Shcheglov 5a313c2595 Support for type arguments and inference in metadata.
Change-Id: Icb019326d73f5d1380c732b36239555a6bcb39d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191483
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 17:26:43 +00:00
Konstantin Shcheglov 14327ea035 Handle NON_CONSTANT_MAP_ELEMENT as a const error.
Bug: https://dart-review.googlesource.com/c/sdk/+/191762
Change-Id: I55c52a364079fbf797b285c48bb7eed070c00b9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191803
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 06:24:48 +00:00
Brian Wilkerson 0599056cb2 Add another example to invalid_null_aware_operator to explain a confusing case
Change-Id: I11319c8075179890400f87cc5a8706e4569e39dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191420
Reviewed-by: Kathy Walrath <kathyw@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-17 23:03:57 +00:00
Daco Harkes 3c55d8bb3e [analyzer/ffi] Support packed Structss
This CL does not add packed structs to `dart:ffi` yet, only to the mock
SDK in the analyzer for testing the analyzer. This means we can review
and land it separately.

Bug: https://github.com/dart-lang/sdk/issues/38158

Split off https://dart-review.googlesource.com/c/sdk/+/186143.

Change-Id: I9c9ac9154e3dec0e05242f57cf7dddf8406df5fb
Cq-Include-Trybots: luci.dart.try:analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-17 22:13:37 +00:00
Sam Rawlins af7d2a4824 analyzer: code quality improvements in task/options.dart
* Add quotedAndCommaSeparatedWithAnd getter to List<String> extension.
  This extension getter allows multiple fields to be initialized in
  ctor initializers.
* Make all ErrorBuilder fields private which enabled analysis that all
  could also be final.
* Refactor ErrorBuilder.code to not be `late final` by using a private
  constructor and a factory constructor.
* Refactor TopLevelOptionValidator _valueProposal and _warningCode to
  not be `late final` by initializing them in ctor initializers.
* Remove the TrueOrFalseValueErrorBuilder class. The class contained
  no useful information and was basically a wrapper around
  `reporter.reportErrorForSpan`. Calling this inline simplifies.
* Change reference in parser.dart as Analysis Server renamed it to
  [_builder] when I refactored one of the fields in options.dart.

Change-Id: Ica867772fca5d3442ab754e588ec07829a822c2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191462
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-17 16:59:14 +00:00
Sam Rawlins 5d1faf6cc6 Refactor yaml utilities in analyzer and analysis_server
* Two extension methods were moved from analysis_server to analyzer, to replace
  identical top-level helper functions in analyzer.
* Add nodes2 which returns a YamlMap with YamlNode keys.
* Privatize two static functions in Merger.

Change-Id: If54e73d6e8133bf1b2a3af809d6bb732c77ab9be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191381
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-17 16:57:05 +00:00
Paul Berry 2724b0020e Clarify nomenclature for computeWhyNotPromotedMessages.
It's been a while since I worked with this method and I'd forgotten
what the parameters meant.  A sure sign that documentation and
clarification are needed! :)

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I815c35af243ed6c9611346a058a1c1bb37ace4db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191480
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-17 11:01:31 +00:00
Keerti Parthasarathy 1a7d39b235 Do not compute hints for third party code
Change-Id: I4d9478fb9ebb92a26a98a9711e6fab1c0c39db59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2021-03-16 23:49:11 +00:00
Konstantin Shcheglov 11e922f761 Update a few documentation comments for elements to remove null.
https://github.com/dart-lang/sdk/issues/45236#issuecomment-800564647

Change-Id: Ic9aa0b120cb0796ad1796c6f34aef8fc5360700a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-16 21:39:41 +00:00
Konstantin Shcheglov fd92cd4ce1 Add Expression.inConstantContext to API.
Change-Id: I13f96d2123e96eea11ccdcef2bb9a301a8afd26a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-16 19:28:30 +00:00
Sam Rawlins 82d16bd715 analyzer: Remove dynamic call from checker
I managed to remove 2 of ~5 calls to _elementType, as the argument
type was known to have a property, `.type`. I removed the null check
from the function, as it never needed to be used; the argument should
always be non-null. Two calls then require null checks, but this does
not change behavior, because null was never passed in there; `dynamic`
would have been returned then, and cast to FunctionType, which would
have failed.

Change-Id: I9b93a11e60e20a99ba8df4b5677e4c5796a49fcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-16 17:14:27 +00:00
Konstantin Shcheglov c0b800ceb5 Issue 45318. Check for dynamic bounded and Function bounded.
Bug: https://github.com/dart-lang/sdk/issues/45318
Change-Id: I5abd2d237cc3a56551471c2a2fc7a9965eb4223c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-15 22:50:14 +00:00
Konstantin Shcheglov 369c36e67c Issue 45299. Fix yield type check for function expressions.
Bug: https://github.com/dart-lang/sdk/issues/45299
Change-Id: I0f9477a632b635d7e1ac8d4c51f51254e5058cff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-15 21:26:44 +00:00
Konstantin Shcheglov 60ea845795 Issue 190731. Support for aliasElement/aliasArguments in TypeParameterType.
Bug: https://github.com/dart-lang/sdk/issues/45291
Change-Id: Ia0378722f0e7c48e7a3042c0ef14d6833c7bf2b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190734
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 18:22:47 +00:00
Konstantin Shcheglov 45e3d3c77f Issue 45291. Support aliasElement/aliasArguments for interface types.
Bug: https://github.com/dart-lang/sdk/issues/45291
Change-Id: I97bab24f4d7cf3232a0260ec3c6abec6a4c310be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190731
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 17:06:17 +00:00
Sam Rawlins e1414089cf Analyzer: avoid dynamic calls while examining Yaml
Change-Id: If569c74bad1d3762deb4cc74ea617d291ec33619
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190727
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 16:50:37 +00:00
Konstantin Shcheglov dd706e1c0c Issue 45263. Fix resolveToBound() to resolve the promoted bound as well.
Bug: https://github.com/dart-lang/sdk/issues/45263
Change-Id: I285e675bdec931b1987ac97045e6f97e55ad3fd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190730
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-03-12 07:23:49 +00:00
Sam Rawlins fa0f4680df analyzer: Remove nullable types from _DisoverAvailableFilesTask:
* remove `isCompleted` field which duplicates `completer.isCompleted`
* make `completer` non-nullable
* make `files` non-nullable
* move `folderIterator` from class as field to `perform()` as local

Change-Id: Ic67dbf8d4e6487152ae1ca6752c45f5c59c70862
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190725
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-11 21:48:31 +00:00
Konstantin Shcheglov 54b2948461 Replace TypeAnnotation.type with null check with 'typeOrThrow'.
Change-Id: I16922aef63d294448436c93004386ee8a3439e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 19:41:10 +00:00
Sam Rawlins d44d590ceb analyzer: Remove unused WorkToWaitAfterComputingResult
Change-Id: I7f3925c19e6375e93fdc67ed394ec1ad472ffd98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190680
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 19:30:11 +00:00
Konstantin Shcheglov 14998dfa5a Fix unlinked API signature for const/static out-of-order.
Saw a crash in logs, was able to reproduce.

Change-Id: I2632c9ec7c3c34e6498f74e17507505128664418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 01:33:21 +00:00
Paul Berry c509ad1e41 Change "could not" to "couldn't" in error messages
See comments at
https://dart-review.googlesource.com/c/sdk/+/186320/4/pkg/analyzer/lib/src/generated/resolver.dart#3423.
On the recommendation of the documentation team, we use a more
informal tone in messages.

Change-Id: I0c243669ebd91b8f4a745530582e0f829769a754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-10 15:26:38 +00:00
Paul Berry 73f9d0cd26 Flow analysis: Remove unnecessary argument from tryFinallyStatement_end.
Flow analysis stopped using this argument (the AST node for the
finally block) some time ago, but I kept it around so I could assert
that clients didn't unnecessarily store assigned variables info for
it.  It's been long enough now that we can eliminate this code
entirely.

Change-Id: I8c64e2b4fc5b154f441ec2d057637f3dc9ced277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-10 13:14:08 +00:00
Sam Rawlins 3a67c5aaa2 analyzer: Remove lateness of LibraryAnalyzer._libraryElement
This field is late and accessed with regularity, requiring ugly initialization
checks.

Change-Id: I307f3736e374991a37777f24264642fdcb73a57a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190100
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-10 05:59:00 +00:00
Sam Rawlins 0471644ac9 Reland: Report unused system libraries with shadowed elements
Fixes https://github.com/dart-lang/sdk/issues/45028

Change-Id: I77d6ea9f0eaa3589402abf6c23aeae4978694f19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-10 00:35:42 +00:00
Konstantin Shcheglov 6550317955 Move updateAnalysisOptions() to CommandLineOptions.
Change-Id: I96e63478f2e3ea65d58a56a1b12dc2726a3d55ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189860
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-10 00:34:32 +00:00