Commit graph

12891 commits

Author SHA1 Message Date
Johnni Winther a811db5bc6 [cfe] Change MapPattern.key to Expression
The key can only be an Expression but was unneedingly wrapped in
a ConstantPattern. Since the shared type analysis only handles
map pattern keys as expressions, the expected properties of
ConstantPattern were not set. Amongst these were the static type
of the key expression, which is know passed directly to the
handleMapPatternEntry method.

Change-Id: I705fc655e440d534ccc442c9c1359c377955b3b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288282
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-13 10:05:16 +00:00
Robert Nystrom 56eaffb392 [flip-patterns] Enable "records" and "patterns" experiment flags.
This turns on the flags for these two language features and makes
them generally accessible.

Doing so causes a number of tests to fail, but the failures are
approved and there are filed issues for them. Most of the
failures are minor or only affect code using the new language
features.

This CL:

- Enables the features in experimental_features.yaml.
- Re-generates all of the various files generated from that.
- Makes some analyzer and front end changes that this CL
  inherited from Paul's original CL flipping all of the 3.0
  feature flags. I don't know what these changes are about, but
  I assume they are necessary.
- Pins a couple of tests to 2.19 since they deliberately test
  behavior that is specific to 2.19. (For most test changes, I've
  landed them separately, but there are a couple of stragglers
  in this CL.)

This doesn't enable "class-modifiers" or "sealed-types" and doesn't
include the core lib changes related to those.

TEST=On bots

Change-Id: Id387753772286a958e20a3589a6e983995f2e4a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286344
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-10 20:02:23 +00:00
Konstantin Shcheglov af52197dd6 Replace declaredElementType with nested 'type' in expectations.
Change-Id: I4cd95528e24b0278f74e270e5685ef2d89d5e505
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288263
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-10 19:35:24 +00:00
Danny Tuppeny c58d445fa8 [analysis_server] Insert "const" for const Color constructor calls for LSP color picker
Change-Id: I2b56d56624f657d190c788a0c6654e2f0040153c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287980
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-10 16:08:24 +00:00
Konstantin Shcheglov c969a87222 Support for IndexExpression, don't report 'Enum.index'.
Change-Id: Ibd67955f9e6e70577d0b5e00edd513b05c5da406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288065
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-10 07:18:30 +00:00
Jake Macdonald 737b6f7356 [flip-modifiers]: flip the flags for sealed classes and class modifiers
Includes several updates to tests that needed to land with this flip, as well as some other tests that needed to be updated and could land separately, but are being included here to expedite things.

Removes some unnecessary experimental release versions, as well as bringing up to date the generated files, which were previously out of sync with the yaml file.

TEST=bots

Change-Id: I71a86d7a86190069b504bd27d687f62b97a7251e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285080
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-03-10 05:27:57 +00:00
Konstantin Shcheglov 74fb9e190f Report RELATIONAL_PATTERN_ARGUMENT_TYPE_NOT_ASSIGNABLE instead.
Bug: https://github.com/dart-lang/sdk/issues/51679
Change-Id: Ia0655afa328dbc20ee7ee0fb62675a0f26f9be19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287940
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-10 01:56:23 +00:00
Konstantin Shcheglov 3f0c013779 Switch DeprecatedMemberUseFromSamePackage_BasicWorkspaceTest to the latest feature set.
Change-Id: Ia38ad1a8cb445385cdf68636d07d571e4105d0e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287920
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-09 19:55:34 +00:00
Konstantin Shcheglov 10ee5fdf94 Implement reporting WarningCode.SDK_VERSION_SINCE
It is not enabled by default yet, because there are existing violations.

Bug: https://github.com/dart-lang/sdk/issues/34978
Change-Id: I60147d4c240d63d2f631513c8dfbd4917c35d47c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287660
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-09 18:59:27 +00:00
Kallen Tu 919eb05b27 [analyzer] Avoid reporting subtype modifier errors on final supertypes outside of library.
Change-Id: If4fba1c08d7dc9d4f65ea56760298e47c65742fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-09 18:09:34 +00:00
Johnni Winther eaedc90684 [_fe_analyzer_shared] Improve handling of map patterns
This adds improved support for map patterns. A new [Restriction]
class replaces the [TypeBasedStaticType.identity] properties and
allows not only for unique values as subtypes but also subsets of
values as subtypes. For map pattern the subsets are defined by
a [MapTypeIdentity] based on the type arguments of the map pattern,
its constant key values and whether it has a rest pattern.

Change-Id: I32b95f519cc161975af17ea82beacbc27ad5bbe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-03-09 17:22:36 +00:00
Konstantin Shcheglov 04f7a2a910 Simplify implementation of FindNode.singleX getters.
Change-Id: I434cf2371dee4269747b21413d6d15cbd4fa4e3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287672
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-09 17:00:48 +00:00
Chloe Stefantsova b16acf4f35 [cfe] Provide pre-desugaring node to flow analysis to fix promotion
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I2a70518975c809f28f0d0f72f7365492ca7d6e83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287601
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-09 15:58:49 +00:00
Konstantin Shcheglov b1b1f47b95 Issue 51561. Fix for a mixin field inference.
Bug: https://github.com/dart-lang/sdk/issues/51561
Change-Id: Ie8654a4e3bb73dd41c7f6fa291fe531a5dcc9fa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287641
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-08 22:45:15 +00:00
Konstantin Shcheglov 18d414d24d Add 'get sinceSdkVersion' to Element.
Bug: https://github.com/dart-lang/sdk/issues/34978
Change-Id: Ibabcbb9f4dcd5ecb0300af05a494dc2e5af14fb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287241
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-08 20:29:57 +00:00
Konstantin Shcheglov 424d56f34c Class modifiers changes for mock SDK, fixes for analyzer, analysis_server tests.
Some of these changes were in the flip CL.
https://dart-review.googlesource.com/c/sdk/+/285080

Change-Id: I3f9d7905aeaedc25f2008410a2b48ff74ef2d74f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-08 18:31:31 +00:00
Konstantin Shcheglov 6e019dcd0b Rename resolution tests to AstNodeNameResolutionTest style.
Any variations are after 'Test', e.g. 'TypeNameResolutionTest_WithoutNullSafety'.

Change-Id: If3316cabf058936dedc294c85b4b9417a6923ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287248
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-08 15:20:08 +00:00
Johnni Winther d451cb64c0 [_fe_analyzer_shared] Only show fields of interest in exhaustiveness tests
Only the fields of a scrutinee type that are used in the cases are
now shown in the test expectations. When the field is not present,
for instance when the scrutinee type is nullable, or the fields are
only present on (some of) the subtype of the scrutinee type, the
fields are shown to be missing with a `-`.

Change-Id: I2d36b230e979dc929d083cfb8f9cdb9f1143d380
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287280
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-08 07:14:47 +00:00
Brian Wilkerson b815ddc2b8 Attempt to fix the windows bot
Change-Id: I23ac16a4a3acdc5efaddf997133aa54d4f366a95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-03-07 22:35:13 +00:00
Konstantin Shcheglov c084056d45 Add a few @Since annotations for mock SDK.
Change-Id: Ie2d726918b16f38261c2c848a59a0f3f1e4b3675
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287060
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-07 21:44:57 +00:00
Johnni Winther 6e16dad3c0 [_fe_shared_analyzer] Use internal constant-to-text
This chances the analyzer and CFE representation of constant values
to use the internal constant-to-text which doesn't include the
node type and in most cases resembles the source code corresponding
to the value.

For now, this is for creating less noise in the test. For the release
of the feature we need a more thorough handling since these texts
can be user facing when producing error messages.

Change-Id: I5b83d8b0c030e4ffb66422057acf5511619368e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287200
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-07 18:52:23 +00:00
Sam Rawlins 10b7b0a001 [analyzer] Move 2 more HintCodes to be WarningCodes, ASSIGNMENT_*, MIXIN_ON_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Ifda5fb5f9bf282d6c97fffb34318e84eb84b76c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286346
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-07 17:11:24 +00:00
Johnni Winther ed33495a33 [_fe_analyzer_shared] Add SpaceCreator
This adds a [SpaceCreator] mixin used to share the code that creates
the [Space] for each pattern. This is mixed into the [PatternConverter]
in the analyzer and a similar [PatternConverter] is added to the CFE.

Change-Id: I0b284b1473b464167aa84f1948264efc4120001d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-07 09:21:44 +00:00
Chloe Stefantsova 82237f9483 [cfe] Support final joint variables in switch statements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I741562bd37cd5f93d4a2d1ccadcb869344bc10a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286926
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-03-07 07:48:25 +00:00
Johnni Winther c9e29fa85f [_fe_analyzer_shared] Include errors in analysis result
This propagates information about reported error to the caller of
a shared type analysis. This is used to properly turn errors into
invalid expressions/patterns, as is normally done in the CFE in
face of errors.

Change-Id: Ibb8adedccb8314fabfe18ecaa3559e32ad7267ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286145
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-06 22:06:00 +00:00
Johnni Winther 8617cc68fa [_fe_analyzer_shared] Use subpattern for CastPattern exhaustiveness
This changes the Space computation for CastPattern to just the
Space for the subpattern. For a non-throwing cast, this is exactly
what the pattern will match.

There is still potential for handling the types rejected by the cast.
For instance recognizing that the (yet) unhandled subtypes of a
sealed type are exhausted by the throw.

Change-Id: Ia846895449f37a970f87a7f6c54a0ff8285df6b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286825
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-06 21:08:11 +00:00
Johnni Winther 207174cc1b [_fe_analyzer_shared] Add Witness to delay witness text computation.
This adds a [Witness] class as the result of an exhaustiveness test.
This allows for testing exhaustiveness without having to compute the
textual representation of the witness.

Change-Id: I6225b6d35a23792ecc15ae769e4b70cab93e2229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286824
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-06 20:42:20 +00:00
Johnni Winther bd02ce7a7f [cfe] Report error on : for default values
Closes #51576

TEST=pkg/front_end/testcases/general/colon_default_value

Change-Id: Ia8ccdf697d876dbefcbf2c5ed98d01634c075e74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286183
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-06 19:04:55 +00:00
Johnni Winther 12ea77b96e [_fe_analyzer_shared] Remove old Space model
This remove the [Space] class from the old algorithm and instead
encodes the patterns into the new model. The [Pattern] and
[Patterns] classes of the new model have been renamed to
[SingleSpace] and [Space], respectively, and a [Path] class is
added to track the path property used in the model of the new
algorithm.

Change-Id: I0c86c738807030be2f9b59f3aefb5bfcf5bbaeee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-06 16:57:16 +00:00
Konstantin Shcheglov 25554cb6e6 Issue 51561. Update SuperContext to check late instance fields of extensions.
Bug: https://github.com/dart-lang/sdk/issues/51561
Change-Id: I6d953cbea3fae8792fecdeb5df3d44b292127c89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286864
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-04 01:59:18 +00:00
Konstantin Shcheglov 08d9d8586a Don't report UNUSED_LOCAL_VARIABLE for already DUPLICATE_VARIABLE_PATTERN.
Change-Id: I14dd9bdd76d006f230653fa74c1410af63d84fd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286866
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-03 20:30:14 +00:00
Konstantin Shcheglov f67f7d11d7 Track a reason for a pattern variable inconsistency.
This allows us report more specific errors.

Bug: https://github.com/dart-lang/sdk/issues/51505
Change-Id: I6e40af1fedce55886a58b954721154db933ede17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286605
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-03 16:14:48 +00:00
Johnni Winther 2a746cb51f [_fe_analyzer_shared] Improve exhaustiveness for null-assert
This improves the exhaustiveness handling for null assert patterns
by extending the space of the subpattern with the null space. This
reflects the fact that null assert will throw on `null` and can
therefore be considered to cover that case.

Change-Id: If344eaaa55dcc70474f45519b53586e7d36e6e80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-03 12:31:26 +00:00
Lasse R.H. Nielsen cc736dfb65 [flip-modifiers]: Reapply "Enforce current library restrictions."
This reapplies commit 0c05e33836
and reverts the revert 029e0cec71.

Tested: Added few new tests, updated existing. Mainly regression testing.
CoreLibraryReviewExempt: Reviewed in original CL.
Change-Id: Ifcc79ce2f9375f607722643a04957b0961e6c295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284304
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-03 09:37:38 +00:00
Konstantin Shcheglov a3038980d5 Update the list of patterns in DartPatternImpl.
Change-Id: Ieb10c848536d087a7cefb6e537d3e3c33321f644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286607
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-03 02:02:38 +00:00
Konstantin Shcheglov 3e62dba022 Issue 50588. Test that EQUAL_KEYS_IN_MAP_PATTERN is reported for double(s).
Bug: https://github.com/dart-lang/sdk/issues/50588
Change-Id: I952d0ec59045c68f63a5f028083cf17c1b633f3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286522
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-03-02 19:56:27 +00:00
Sam Rawlins 2c31548893 analyzer: Remove references to unimplemented FILE_IMPORT_*_LIB_REFERENCES_FILE_* rules
Lint replacement suggested at
https://github.com/dart-lang/linter/issues/4103

Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I2578c91af3f66a816d67bb0e9ecfa22802febf94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286345
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-02 18:57:08 +00:00
Konstantin Shcheglov bdd9535b4e Prepare to publish analyzer 5.7.1 and _fe_analyzer_shared 55.0.0
Change-Id: Ie9c95abba680a8d564f8577a8bf91604ec8d5022
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286341
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-02 18:22:31 +00:00
Konstantin Shcheglov fbb6185449 Remove lazyEqualEqual()
It is not used de-facto, and I don't know that we have semantics for it.

Change-Id: I450b164a96b1a16b89b85811e84338110abbae99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286342
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-02 17:09:54 +00:00
Devon Carew a8afc781b4 [pkg/analyzer] bump the min. sdk version
Change-Id: I92b086de357e28239580fd17f4b1aaf29447941c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286321
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-02 16:09:45 +00:00
Johnni Winther 1bf274e144 [_fe_analyzer_shared] Support FutureOr in exhaustiveness
Change-Id: I76139d264527f9c2cf8a7a1cfc0fa7e1648baa11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286181
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-02 10:29:55 +00:00
Konstantin Shcheglov ad15774558 Issue 51567. Implement constant equality as primitive equality
Bug: https://github.com/dart-lang/sdk/issues/51567
Change-Id: I7821598a761573519205b0ea06b13f433639282b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-01 20:58:57 +00:00
Konstantin Shcheglov c1215061e2 Clean up PatternConverter a little.
Change-Id: I1e16e7ad0b59c5a912da040172ec5c5ccd93d490
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286203
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-01 20:17:37 +00:00
Vyacheslav Egorov ca6e3499b8 [analyzer] Expose inlineKeyword through ClassDeclaration
This is needed to implement dartfmt support for inline classes, which
is needed to unblock enabling them internally for experimentation.

Bug: b/271244238
Change-Id: Ic9928aefbd5373f5bb0a0ae7998da54fc1f68b7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-03-01 19:24:37 +00:00
Sam Rawlins 5aaebf2337 [analyzer] Move 4 more HintCodes to be WarningCodes, OVERRIDE_ON_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Ib97807551c032c48ce47ee9a53752b695d1b9bc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286200
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-01 19:10:03 +00:00
Kallen Tu 4f6ccd9fee [analyzer] Report an error when a subtype of a base or final type is not base, final or sealed.
Change-Id: Ie9c943e6ce7d3b1c746ccd4ee3757886dd619c5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-01 19:01:59 +00:00
Konstantin Shcheglov 814eda8edc Add PatternField.effectiveName
Change-Id: Icbeb5bfa8ee96fbed8f60f8b89ff7bf436579239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286064
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-01 16:59:00 +00:00
pq b05cc9442a new test for failing super param comment resolution
See: https://github.com/dart-lang/sdk/issues/51578

Change-Id: Icf000e008f5e04f6ab948b2d226877efa19bfd1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286080
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 21:24:35 +00:00
Danny Tuppeny e231f12420 [analysis_server] Don't endlessly rebuild analysis contexts on PathNotFound errors
Fixes https://github.com/Dart-Code/Dart-Code/issues/4280.

Change-Id: I8f36672dfd5fcca2e4be87408d385219b0a81d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 20:27:43 +00:00
Konstantin Shcheglov 7b583f2052 Don't report CONST_EVAL_TYPE_BOOL_NUM_STRING for the right operand.
It is not required by the specification.

Change-Id: I65863df55194d441885436b8a811858815a3d957
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 20:01:47 +00:00