Paul Berry
58dc586929
Remove redundant line number from referencedBeforeDeclaration.
...
Context messages are already displayed in a way that makes it easy for
the user to locate the line of code in question; it's unnecessary to
include the line number in the context message itself.
See discussion at
https://buganizer.corp.google.com/issues/179782591#comment9 .
Change-Id: I2d1383c4cee0ece0d302449302d1f1902fbf136c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2021-03-24 14:07:51 +00:00
Sam Rawlins
97cd131c9a
analyzer: Introduce cannot-ignore analysis option.
...
Fixes https://github.com/dart-lang/sdk/issues/45404 , which describes the option
in detail.
This removes all unfortunate exceptions for dart2js test code and for flutter
code. This removes the lateness of one final field.
Fixes https://github.com/dart-lang/sdk/issues/44237
Fixes https://github.com/dart-lang/sdk/issues/42977
Fixes https://github.com/dart-lang/sdk/issues/45230
Related to https://github.com/flutter/flutter/issues/52899
Change-Id: I054f487fafe2742ae57da1d2ccd2d52dce4188bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192560
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-03-24 13:32:49 +00:00
Paul Berry
da29d5af66
Share checkForFieldInitializerNotAssignable betwen resolver and ErrorVerifier.
...
In order to implement "why not promoted" functionality for constructor
field initializers, we will need to call
checkForFieldInitializerNotAssignable from the resolver, so that we can pass it
failed promotion information. So move it into the
ErrorDetectionHelpers mixin.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I95094e198a97608bf27f84cfb3cac40824a30ba4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192723
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2021-03-24 12:10:09 +00:00
Paul Berry
ca8663492d
Share checkForInvalidAssignment betwen resolver and ErrorVerifier.
...
In order to implement "why not promoted" functionality for variable
declaration initializers, we will need to call
checkForInvalidAssignment from the resolver, so that we can pass it
failed promotion information. So move it into the
ErrorDetectionHelpers mixin, along with _checkForAssignableExpression
(which it calls).
_checkForAssignableExpressionAtType can now be private, since all of
its callers are now in ErrorDetectionHelpers.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I6655e3a655d330d61459692804854c89c0dcff70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192612
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2021-03-24 12:10:09 +00:00
Paul Berry
20d9c6eb3a
Flow analysis: implement "why not promoted" logic for boolean conditions
...
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: Ia8f3a5ad2971dfb6baeefb0d2f9c6998af0d897e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192611
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2021-03-24 12:10:09 +00:00
Paul Berry
eb37227666
Flow analysis: implement "why not promoted" logic for logical binary operators.
...
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: If03750edf6bdf13fc2677e0c09f49f70d0da744e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192608
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2021-03-24 12:10:09 +00:00
Paul Berry
6c665c4607
Flow analysis: implement "why not promoted" logic for most binary operators.
...
`&&` and `||` will be addressed in a follow-up CL go through a
different code path in the analyzer.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I20732ceceb113017a0b1e77134b1e28c4c924fbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192607
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2021-03-24 12:10:09 +00:00
Konstantin Shcheglov
4a04e0ae3d
Prepare to publish analyzer 1.3.0 and _fe_analyzer_shared 19.0.0.
...
Change-Id: Ic0983c724e01ca11d1eb72cd9e5424a74874dcc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192862
Reviewed-by: Kevin Moore <kevmoo@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-03-24 06:13:43 +00:00
Konstantin Shcheglov
6b7398227f
Fix unlinked API signature for adding '=<nothing>;'.
...
Change-Id: Idfab6f4e977170c03f0e75476e3524c9312b01ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192860
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2021-03-24 04:08:47 +00:00
Konstantin Shcheglov
edec078c89
Return the actual first token from VariableDeclarationListImpl.firstTokenAfterCommentAndMetadata
...
Otherwise we cannot find the node when using the offset of `const` token.
Bug: https://github.com/Dart-Code/Dart-Code/issues/3205
Change-Id: Ida8dbc0bd48f4ae4c857d2ffd236b80a1c6cbc74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192840
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-03-24 03:22:23 +00:00
Konstantin Shcheglov
df59fd9a3e
Issue 45127. Fix for metadata on enum constants.
...
Bug: https://github.com/dart-lang/sdk/issues/45127
Change-Id: I8e98bc5fd0ba1e04cd88c3a175a08f67034ebb82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-03-24 01:10:51 +00:00
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
pq
706758a142
linter 1.2.1
...
Change-Id: I4d2ccc0bcc4128d60d76ea5119594d946fec35c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2021-03-23 15:01:16 +00:00
Konstantin Shcheglov
0c4fdb9ca4
Fix two Windows bot failures.
...
TBR
Change-Id: I3cda819e1deb953e0d899430f4e363541c4fef15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-03-23 04:24:55 +00:00
Sam Rawlins
e890c2ab91
analyzer: Add failing test case for deferred element in annotation argument
...
Bug: https://github.com/dart-lang/sdk/issues/45418
Change-Id: I6332caab0ecc5604d0631f4669314355f699b720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192485
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2021-03-22 20:49:52 +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
d382ad0896
analyzer: Add new test for deferred type argument in annotation
...
Change-Id: Ibf29aec03ee912657142bba574309e0e9eeaedd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192486
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2021-03-22 20:41:50 +00:00
Sam Rawlins
f578bafad7
analyzer: add generic-metadata test case to argument_type_not_assignable tests
...
Also refactor these tests, in order to get the right experiment. Factor out
common test cases into a mixin, leave two test classes, one of which opts out
of null safety.
Existing tests are left alone except that two which were failing are no longer
failing (simple change in span or diagnostic code).
Change-Id: I2b0dfb4c1df38c6fbd76e5490bbbbd41653edc1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192502
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2021-03-22 20:41:40 +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
Sam Rawlins
2c13c7ea80
analyzer: Enforce avoid_dynamic_calls lint
...
Change-Id: I496ed3abbb29ebef14542636aaf1b878f3420740
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192288
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2021-03-22 18:47:14 +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