Commit graph

10428 commits

Author SHA1 Message Date
Konstantin Shcheglov 3ce196935e Implement inference via type aliases with aliased InterfaceType.
Change-Id: I1d2bba09f19468bc8e095c5ef4a39c09365eb2a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193450
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 23:39:57 +00:00
Konstantin Shcheglov 8c4d10d9cf Tests for IMPLEMENTS_SUPER_CLASS and MIXINS_SUPER_CLASS via type alias.
Also a small tweak for reporting repeated implements/with.

Bug: https://github.com/dart-lang/sdk/issues/45489
Bug: https://github.com/dart-lang/sdk/issues/45526
Change-Id: I6b3e7cb545ce5c63b8facd8b2e55593a45196779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 21:42:31 +00:00
Paul Berry 6c30a7d582 Flow analysis: implement "why not promoted" logic for index expressions.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I52a0fa33dbeb4f6382dd8b3154ead25ca2065878
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193088
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-30 18:24:11 +00:00
Paul Berry 20acfbc876 Move checkIndexExpressionIndex checking to resolver.
In order to implement "why not promoted" functionality index
expressions, we need to call checkIndexExpressionIndex 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: Idc70e3421142da1d3100c288c912b6483a91b28c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 18:24:11 +00:00
Konstantin Shcheglov fa243e700a Issue 45492. Report TYPE_ARGUMENT_NOT_MATCHING_BOUNDS for not regular bounded type as a type alias body.
Bug: https://github.com/dart-lang/sdk/issues/45492
Change-Id: I303a7066c356e645d549960f66c1d7b8d50f307a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193452
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 16:50:11 +00:00
Konstantin Shcheglov fcb9bfb81b Report IMPLEMENTS_REPEATED and ON_REPEATED also when via type alias.
Change-Id: Ied864fe708b6f00976e0629f8f3e514b693b5129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193451
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 16:50:02 +00:00
Daco Harkes 4ba4fd3f1d [analyzer/ffi] Inline array annotation const dimensions
Moves the Array forwarding constructors and _ArraySize class out of
the patch files so that the analyzer can reason about them.
(The analyzer does not include patch files, because it does not know
whether it's analyzing for VM or JS backend.)

Closes: https://github.com/dart-lang/sdk/issues/45507

Change-Id: Ia0eb4bbca40b906a1e636714f53c5c73dcfc3cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193403
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-30 00:28:57 +00:00
Daco Harkes 93a187e6c8 [analyzer/ffi] Error on sizeOf<Handle>()
Test covers both analyzer and CFE throwing an error. (But does not
test what error.)

Closes: https://github.com/dart-lang/sdk/issues/45100

Change-Id: I8b820347945d88304d3f03d7d03f156b7111db42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193405
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-30 00:20:52 +00:00
Daco Harkes 86635c76fa [analyzer/ffi] Fix NPE in ffi_verifier
Closes: https://github.com/dart-lang/sdk/issues/45498

Change-Id: I836c52b03800bc8282e5f26168f1feab93068b8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193304
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-29 15:56:18 +00:00
Konstantin Shcheglov 7374f441f3 Add TypeProvider.isNonSubtypableClass, deprecate TypeProvider.nonSubtypableClasses.
Change-Id: I78beaaeb763c33420d84c33b0e87cd5310f99fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193094
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-29 02:33:52 +00:00
Brian Wilkerson 7f54fc96e5 Add documentation for several more codes
Change-Id: I012db56773acee6a81fbb6a33958beb686793ec9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-28 21:16:11 +00:00
Konstantin Shcheglov 5621c9f767 Check for TYPE_ARGUMENT_NOT_MATCHING_BOUNDS when generic_metadata is enabled.
Change-Id: I32b4963f46c232a0ab41fb1b55ffe1c8723a34e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193160
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-27 23:56:46 +00:00
Konstantin Shcheglov 2c02737d7a Support for bounds of generic function types for raw-depends / not simply bounded.
Change-Id: I568f4ebb922b3ce40debff1f4ce20a9ac580f29d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193141
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-27 21:08:06 +00:00
Paul Berry a7b0f5108d Flow analysis: implement "why not promoted" logic for compound assignments.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I57a2c62b8450c313887b516d6fe2ef85fdd0d92b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-26 00:29:24 +00:00
Paul Berry 79bf4f33ae Clean up nomenclature around whyNotPromoted.
We used to have some variables called `whyNotPromoted` and others
called `whyNotPromotedInfo`, with no obvious distinction between the
two names.  Now we use `whyNotPromoted` for variables holding the map
returned by `FlowAnalysis.whyNotPromoted`, and `whyNotPromotedList`
for variables holding a list of such maps.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I3823d16ef908a833e4d4526ae1c3576c73ecf1fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-26 00:29:24 +00:00
Konstantin Shcheglov 92130a010e Tests for DAS services and generic annotations.
Change-Id: I063c78ae778366e60bb0d4aca55c4e7fd70f3d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193091
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-25 23:38:24 +00:00
Konstantin Shcheglov 4af81e2a5b Issue 45459. Report EXPERIMENT_NOT_ENABLED instead of INVALID_GENERIC_FUNCTION_TYPE when nonfunction_type_aliases is not enabled.
Bug: https://github.com/dart-lang/sdk/issues/45459
Change-Id: I0773f15e4697620427f4449622a592e40b5a5de4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-25 21:43:04 +00:00
Janice Collins 182eb2d5c5 Try removing an extra null check in cloneNullableToken.
When trying to update to analyzer 1.3.0 dartdoc started crashing
occasionally in CI with the following exception:

https://github.com/dart-lang/dartdoc/pull/2589/checks?check_run_id=2195215917#step:6:3411

Reading the code suggests that returning a null here should be an
OK thing to do, but if this is intended to enforce that an invalid
key should never be passed to this method, some other solution
will need to be found.

Change-Id: Id210a0f8feb6197e7a65569bfaed4d599be4b3c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193062
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2021-03-25 20:48:54 +00:00
Konstantin Shcheglov 97daca81be Report an error when a type alias that expands to a type variable is used where a class is expected in hierarchy.
https://dart-review.googlesource.com/c/sdk/+/192743

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

Change-Id: I5d32236ddff7403eb739ca8b7de421f7f5a36ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193001
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-25 18:49:34 +00:00
Jens Johansen ac9b4aab8d [parser] More specific error messages when recovering new/const/Map/Set/List with said literals
Follow-up to https://dart-review.googlesource.com/c/sdk/+/190022

Change-Id: Id42336216267dcbf481ae6e111177e6296ea6779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-25 13:27:03 +00:00
Paul Berry 6a2df0de92 Remove unnecessary call to checkForInvalidAssignment
Previously, the ErrorVerifier was checking assignability for any `=`
or `??=` assignment whose LHS was not a simple identifier.  But this
case is unnecessary; it's already handled by the resolver.

Change-Id: Icc44ab3d13b0a8300fe2ebb7ca134086291a29cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192733
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-25 02:01:33 +00:00
Paul Berry f161e228e4 Flow analysis: implement "why not promoted" logic for assignments.
This CL handles ordinary assignment expressions, variable declaration
initializers, and constructor field initializers.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I06bae2c7d57213bd7769c931a03080d148af3dbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192724
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-25 02:01:33 +00:00
Sam Rawlins c557efc6bf analyzer: Allow lint rules to be ignored with cannot-ignore
Change-Id: Ib86d4f58595a564c02c804fefd4d5ab05bd35a2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-24 20:42:32 +00:00
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