Commit Graph

8378 Commits

Author SHA1 Message Date
pq eff76309dc validate pubspec screenshot paths
See: https://github.com/dart-lang/sdk/issues/50179

Change-Id: I589809f17d45adfc6f1e3850d2109e58ec47af13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-11-03 20:44:48 +00:00
Johnni Winther 5baa4af7d8 [analyzer,cfe] Add 'views' feature and support for 'view class'
This adds the 'views' feature flag together with parser support
for 'view class'. If the feature is not enabled, an error is reported.

TEST=pkg/front_end/parser_testcases/views/...

Change-Id: I813ac86a0e7de9f0a5729c6d7ae35b82d1258ae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265780
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-11-02 11:09:59 +00:00
Konstantin Shcheglov 88f5b4816d Push all options for elements textual dump into ElementTextConfiguration.
Change-Id: Iff23553c00ed2d9870ee7507990751c4ac9d0bd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266867
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-11-01 20:08:07 +00:00
Konstantin Shcheglov d68d1fff0d Remove the partial 'extension types' implementation from analyzer.
https://github.com/dart-lang/language/blob/master/working/1426-extension-types/feature-specification.md
was abandoned.

https://github.com/dart-lang/language/blob/master/working/1426-extension-types/feature-specification-views.md
is the new specification for a similar feature.

Change-Id: Ibacce3529e578c554059266bc4b1b67a33595158
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266866
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-11-01 17:15:39 +00:00
Konstantin Shcheglov 3cd43b3aac Duplicate tests with 'switch' statements, to run them with experiments, and with language 2.18 - without.
Change-Id: I003fedc102ef044ff8b58883ad1fbfa702dbdd00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266780
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-10-31 22:31:15 +00:00
Samuel Rawlins 37d1142d35 Revert "[analyzer] report dead code for conditional access for definitely unassigned variables"
This reverts commit f552ffa782.

Reason for revert: broke google3

Original change's description:
> [analyzer] report `dead code` for conditional access for `definitely unassigned` variables
>
> Fixes #50308
>
> Change-Id: If7b752520169a11b15590aa6e2f9a4fafc9da18f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266381
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>

TBR=srawlins@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com,asashour@yahoo.com

Change-Id: I67856a7bcb8ea31c9073638df8c0b2e66cbf9a90
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266661
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-10-31 14:17:27 +00:00
Ahmed Ashour f552ffa782 [analyzer] report dead code for conditional access for definitely unassigned variables
Fixes #50308

Change-Id: If7b752520169a11b15590aa6e2f9a4fafc9da18f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266381
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-10-30 22:29:07 +00:00
Konstantin Shcheglov 56dcbe8c8e Implement field promotion for the analyzer.
A field is promotable if it is private and final, and there is no
non-final field or concrete getter with the same name in the same
library.  This is the rule the language team has chosen to adopt for
which fields are promotable, because it's sufficient to ensure that
the promotion is sound, and straightforward to specify.  A more
complex rule could principle identify more fields that are soundly
promotable.

The rule has a hidden complexity, though: in circumstances where a
concrete class overrides noSuchMethod and implements an interface, if
the interface contains a private getter (or field) and the concrete
class doesn't provide an implementation for it, the compiler will
create a synthetic noSuchMethod forwarder; for soundness, this needs
to block promotion as well.

So the analyzer needs to partially replicate the logic the compiler
uses to determine whether a noSuchMethod forwarder is needed.  This is
handled by a new file, field_promotability.dart, which walks the class
hierarchy to determine which private fields and getters are in the
interface of any given class but not in its implementation.

Field promotion is not yet enabled by default; to use it you need to
enable the experiment "inference-update-2".

Bug: https://github.com/dart-lang/language/issues/2020
Change-Id: I5f4ebb6b19626961b9b4c904d69670212668552b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262865
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-30 20:02:49 +00:00
Ahmed Ashour b0b3ee8ea8 [analyzer] dead code with for statement updaters (method invocation)
Bug #43511

Change-Id: Ie784f30f97481e943087f47d6b7dc42b075334f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266388
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-10-30 16:09:33 +00:00
Konstantin Shcheglov bcdd9c4fba Use FooImpl in BarElementImpl, interface element children and top-level declarations.
Change-Id: I22973b86a72c29e096b78687f19846a6063acb83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266480
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-28 21:18:26 +00:00
Konstantin Shcheglov ce591144b0 Move a few ForStatement tests.
Change-Id: I972f9162d456c1a62c6bf9a7b5e645a52a214ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266444
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-28 19:10:48 +00:00
Konstantin Shcheglov 743b4edcce Issue 50078. Implement variableTypeFromInitializerType()
Bug: https://github.com/dart-lang/sdk/issues/50078
Change-Id: Ie07c99fea07d9a4ffda33b841ee9365fff2caf0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266440
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-28 18:29:27 +00:00
Konstantin Shcheglov 2dfcce6a90 Check for the matched RecordType shape.
https://github.com/dart-lang/language/pull/2569

Change-Id: Id26c0538718cb299dc319d1a905d8dd6fc7d151b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-27 20:32:57 +00:00
Sam Rawlins 1739cc6d89 Add BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR hint
This is similar to BODY_MIGHT_COMPLETE_NORMALLY (the static error),
BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE (the Hint for nullable return
types), and RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR, combining the
rules from each.

https://github.com/dart-lang/sdk/issues/49215 (but maybe doesn't close,
if the core issue is the VM issue)

Change-Id: I9a010e5a3f0f88abfdab479339e5e76759ae9d92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247863
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-27 18:21:47 +00:00
Ahmed Ashour fa4417bcb7 [analysis_server] RemoveDeadCode to remove following statements after dead do while
If the `do` statement has a `break`, then don't mark the following statements as dead, and don't offer a fix (for now).

Bug #43511
Bug #49091

Change-Id: I5e39aaee3dd49dc15ef2e4356b913e77e73baa75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263900
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-27 15:51:44 +00:00
Sam Rawlins f5e3e61da5 Fix COULD_NOT_INFER on top-level elements
Fixes https://github.com/dart-lang/sdk/issues/49308

Change-Id: I303ac7dda326504e73c6b612625d5eec57fe539b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262540
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-10-27 02:58:00 +00:00
Ahmed Ashour 931961eac8 [analyzer] dead code with for statement updaters
TEST=ci

Bug #43511

Change-Id: Ie7ad75b1810d1483558ea18818f30c02730da312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263940
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-26 20:31:00 +00:00
Konstantin Shcheglov 9f35115b90 Use FooImpl in BarImpl getters/setters, property related.
I think we might get away with this now, because we don't let users
create elements manually.

Presubmit in google3 looks green.
https://fusion2.corp.google.com/presubmit/tap/483535261/OCL:483535261:BASE:483575659:1666678949553:5d26313d/targets

Change-Id: Id9618e2d8a15ab98c5919750461c508e87f76c7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265405
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-26 03:49:43 +00:00
Sam Rawlins 9896f1c647 Enable the unnamed-libraries experiment by default in 2.19.0
TEST=tests/language/library/unnamed_library_test.dart

Bug: https://github.com/dart-lang/language/issues/1073
Change-Id: I1c7fa7b4ee4450e344a7613525765e4ab590cc8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265381
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-10-25 21:10:57 +00:00
Konstantin Shcheglov afb9609261 Deprecate buildSdkSummary2(), use buildSdkSummary() instead.
Change-Id: Iaceb38251047ba4d2cb3e051c096f148b810fbb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265407
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-24 22:32:48 +00:00
Konstantin Shcheglov e46bade3d0 Remove a few 'is! MixinElement'.
MixinElement does not implement ClassElement anymore.

Change-Id: I0c05f8720b202ad79f3105a4638d8d3d4ff7a404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265403
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-24 21:33:37 +00:00
Konstantin Shcheglov b8ffc08d5b Add AnalysisDriverForPackageBuild.sdkLibraryUris
https://github.com/dart-lang/build/pull/3389

Change-Id: Ib54ba5d5411fc6213ecf1733dd056f9347f27462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265401
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-24 21:06:27 +00:00
Konstantin Shcheglov 8c1b05cd8e Create CommentImpl directly, without AstFactory.
Change-Id: I61293105570affe50340382bae250892ccfc9180
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265400
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-10-24 20:13:57 +00:00
Ahmed Ashour 5e75bb14a5 [_fe_analyzer_shared] handle $this in String interpolation
Fixes #50263

Change-Id: I4fdfab69a2d462768848f01aceb450f266e09072
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-24 16:41:13 +00:00
Konstantin Shcheglov 79b11174a2 Stop using AstTestFactory and remove it.
Change-Id: Ic0dd0794c2ed3045149d2605c340852b3f187a28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265184
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-24 16:08:12 +00:00
Daco Harkes a67c79b017 [analyzer/ffi] Native static checks
Bug: https://github.com/dart-lang/sdk/issues/49803
Bug: https://github.com/dart-lang/sdk/issues/50097

Change-Id: Id5b52be88937bcf9245f98e71afa56f079f288f0
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265085
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-10-24 10:04:34 +00:00
Konstantin Shcheglov 1244294c09 Enable overridden_fields in analyzer/.
Change-Id: Ie7dc6d1d8c5347fc38bf271aaa074db2da4d3e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265221
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-21 23:15:08 +00:00
Konstantin Shcheglov 53898496a6 Use named parameters in few AST nodes.
Change-Id: I16a63c7554d63103e05a783e1c11748d9535ca7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-21 22:43:49 +00:00
Konstantin Shcheglov 664c021374 Deprecate xyz2 in elements.
Change-Id: I0dbf25882cf66670ce2d69dd22aceb053be9feb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265182
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-21 22:07:47 +00:00
Konstantin Shcheglov 7840c54107 Report EXPECTED_ONE_LIST_PATTERN_TYPE_ARGUMENTS.
Change-Id: I59f2227dea39f13660e360815b1cf7d60c995a0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-21 21:52:18 +00:00
Konstantin Shcheglov 30c4cb00b8 Add a few more tests for PART_OF_DIFFERENT_LIBRARY.
Change-Id: I685874502d49e4a6b4164bb25cf449423659514a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-21 18:25:08 +00:00
Danny Tuppeny 27d417dc09 [analyzer] Fix setter in test
Change-Id: Ie5d31dcf300936690d9cf476bed64b8615474e8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265090
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-21 17:15:36 +00:00
Danny Tuppeny 3e587da7f0 [analyzer] Add the ability to locate an Element from an ElementLocation
Change-Id: If2f3bfcdaa330dc1bcb9c1078500e982660ae8c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-21 15:26:46 +00:00
Konstantin Shcheglov 6c60f506c8 Resolve RecordPattern(s).
Change-Id: I229efb591cbb2d6cfe77b38155526f881fee7dbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264891
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-21 09:10:27 +00:00
Konstantin Shcheglov 4461156b2e Add a few more tests for extractor pattern resolution.
Change-Id: Ic0cb05ae0bbc958e0136f4c6abac9e72327c4f75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264888
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-19 20:43:47 +00:00
Danny Tuppeny 1b38b7bb7b [analysis_server] Move TestCode from analysis_server to analyzer
Change-Id: I81333240d7693b66416ce6bb308f980b264a2238
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264920
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-19 19:58:47 +00:00
Konstantin Shcheglov eea6fb106d Look for BUILD.gn files to identify ContextRoot(s) with GnWorkspace.
This rehabilitates language server support for Fuchsia.

This makes GnWorkspace more like PubWorkspace, not like BlazeWorkspace. The workspace is the location of `BUILD.gn` file (and is identical to the package, although I did not change this in this CL). And there must be also `.jiri_root` somewhere above it.

We don't look for `pubspec.yaml` files to decide that we have a new `ContextRoot`, instead we rely on `.dart_tool/package_config.json` created by `Pub` from `pubspec.yaml`. For GN, I had to specialize it to look for `BUILD.gn` files.

With this change `BUILD.gn` takes preference over any other signal, so we don't care if there are `pubspec.yaml` files.

Fixed: fuchsia:109640
Change-Id: I2277336bd377abb9d8c8c33529183e21b2f51c4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-19 17:57:50 +00:00
Konstantin Shcheglov d923f69436 Resolve WhenClause in SwitchStatement cases.
Change-Id: I836d0bec357597490ad7302e90ff9e4740547810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-19 17:27:38 +00:00
Konstantin Shcheglov f14aba03e7 Use shared analyzeIfStatement()
Change-Id: I9271fb21538faeacc0625e8c48f7add860f86e60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264726
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2022-10-19 00:40:47 +00:00
Konstantin Shcheglov f42bb9dffc Support for replacing WhenClauseImpl.expression
Change-Id: I0e19b5bdbc32b77ccb29bb40ffd8191c04ffa208
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264728
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-18 22:39:49 +00:00
Konstantin Shcheglov 5a0f6c2aef Remove released languge features from experiments.
Change-Id: I3b3398f8c7a932e2b4e0ceace20d10ff0d520150
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264727
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-18 22:31:46 +00:00
Konstantin Shcheglov e3f77e928f Add BlazeWorkspace.forBuild()
Change-Id: I2b896716c7dc7f53c400e6ea516ecf0439e347b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264723
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-18 20:34:17 +00:00
Konstantin Shcheglov 138c956bcd Parse CaseClause for IfElement.
Change-Id: Id0ea8da51b3492768d734884fee43d913f9c69ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-18 18:30:39 +00:00
Konstantin Shcheglov 8dc77f6fdc Remove READONLY support from BlazeWorkspace.
It was deprecated in 2019.
https://sites.google.com/a/google.com/git5fordummies/Home

Change-Id: I0b2d4fb0624bc70b7952de5496d280c84172beb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264600
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-18 16:06:08 +00:00
Paul Berry 5e29849393 Parser: consolidate handleCaseMatch and endCaseExpression.
There was no need for both of these listener callbacks, because they
were always called together.  Since `beginCaseExpression` is actually
used, it makes sense to keep `endCaseExpression` and get rid of
`handleCaseMatch`.

Change-Id: I544096b2c2b2814e8cc0c8606455855cb77c9e60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264102
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-15 13:51:59 +00:00
Paul Berry 9aab3c7746 Patterns parsing: add support for guards.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I21db09c9d8c1d359e1b125eea2bae2749cdb72fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264101
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-14 20:14:20 +00:00
Paul Berry 4cf63fb382 Parser and listener API changes for supporting pattern guards.
These are in their own CL so that it's easy to verify that no
functionalty has changed, even though a lot of parser expectations
files are affected.

In a follow-up CL, I'll add code that actually parses pattern guards.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I79f5a02df45e29b69aa4d8348cfdf27042ada9d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264020
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-14 15:42:12 +00:00
Paul Berry 5923b883db Parser: add support for wildcard patterns.
The bare identifier `_` is treated as a variable pattern wherever it
appears, even though other bare identifiers are sometimes treated as
constant patterns.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I475ef627b6d0bf519a1972aa5ec683e2d032f02b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263280
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-10-14 14:04:59 +00:00
Danny Tuppeny b5846d8aba [analysis_server] Fix renaming of enum constants
Fixes https://github.com/Dart-Code/Dart-Code/issues/4215.

Change-Id: Ia55d7ffe5230c483218729e2c51c360dbb24bb57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264003
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-13 19:32:56 +00:00
Ahmed Ashour 10e7e478a2 Fix typos
Fixes #50184

Change-Id: If17f838d932171e30ef92d1bda8d4918e7e08a8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263622
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-12 14:12:42 +00:00