Konstantin Shcheglov
a565638b91
Issue 51689. Report when 'super' is used as a standalone expression, not as a receiver of an invocation.
...
Bug: https://github.com/dart-lang/sdk/issues/51689
Change-Id: I1c9a407ff3b17034a18842484a28b0f9c82bcd83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295500
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-17 16:42:47 +00:00
Sam Rawlins
9d4d48949c
Add a top-level variable strict-inference test case
...
Fixes https://github.com/dart-lang/sdk/issues/38426
Change-Id: I31487b28f32df5109c1cf240d87ce828e718e76c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2023-04-17 16:24:15 +00:00
Brian Wilkerson
5f2d9cf41f
A cursor at the end of a file should be inside the compilation unit
...
Change-Id: I68ff9337af9a416f18573e500a10eec1194adeaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295400
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-14 19:04:48 +00:00
Konstantin Shcheglov
40b9404d8e
Issue 52004. Check RecordType(s) in UnknownInferredType.isUnknown
...
Bug: https://github.com/dart-lang/sdk/issues/52004
Change-Id: Ib7d736f44c683b309ae3d55b2b848577c56c8a79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295102
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-13 22:14:51 +00:00
Sam Rawlins
2f30f88916
Mark deprecated Hints with Warning aliases as deprecated
...
This will help with any references to deprecated Hints in other
codebases, like nnbd_migraion or linter...
Change-Id: Iccd43d8e3113e6e3e0e458bf959c7f4d48185f35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294182
Reviewed-by: Nate Bosch <nbosch@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2023-04-13 20:07:36 +00:00
Kallen Tu
2954986a7e
[parser] Add errors for using class modifiers on enums.
...
Otherwise, in its current state, there's no clear error for any modifiers when used before an enum declaration.
This follows the same format to FINAL_MIXIN_CLASS and those groups of errors.
Bug: https://github.com/dart-lang/sdk/issues/51935
Change-Id: I8174b6894c95fef5c0f4704927b161942c19d3ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294122
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2023-04-13 14:59:57 +00:00
Konstantin Shcheglov
c46833d148
Move tests from AnalysisDriverResolutionTest and remove it.
...
Change-Id: I8945ca2e7356709893645ee78a06b94130192e65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-12 04:33:18 +00:00
Konstantin Shcheglov
72a5f53906
Report PATTERN_NEVER_MATCHES_VALUE_TYPE on types for a few patterns.
...
Patterns that are omitted: list and map patterns.
We could report on `<int>[` in `<int>[0]`, but it feels a bit weird.
Change-Id: I2f372fadeb2f3e6c1867d4ac0eae01884b018b92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294625
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-11 22:05:10 +00:00
Konstantin Shcheglov
4ba4d11aea
Report PATTERN_NEVER_MATCHES_VALUE_TYPE for RecordType(s).
...
Change-Id: I9ade865ae8cd86f97b41d862c30876a31ee32b51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294620
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-11 18:15:30 +00:00
Konstantin Shcheglov
e6d93186a5
Move more tests from AnalysisDriverResolutionTest into specific.
...
Change-Id: Ic8c433cff6b4205804a123ac91cccd5803c8133e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294431
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-11 17:34:16 +00:00
Jens Johansen
99395b2b0c
[parser] Recover differently from mixin with clause
...
Fixes #50838 (https://github.com/dart-lang/sdk/issues/50838 )
Change-Id: Ib0f0c01a07ab6232732a2be6c3aec34cb4bfdd29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292360
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-11 16:29:53 +00:00
Konstantin Shcheglov
e0a2ab175a
Issue 52001. Set default type for extension type parameters.
...
Bug: https://github.com/dart-lang/sdk/issues/52001
Change-Id: Ibebc1bdf78bdb5565e7b715e649d00806c138fac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294426
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-11 00:16:58 +00:00
Konstantin Shcheglov
83a2037037
Move tests from AnalysisDriverResolutionTest into corresponding resolution tests.
...
Change-Id: I35ff246c45f5f7134686c826dbf00b3a4d1ef39e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-10 23:05:57 +00:00
Konstantin Shcheglov
dfea94f5de
Move and rewrite PrefixedNamespaceTest.
...
Change-Id: I7bb1285dd8ef91cb1cac05d9d55155e36ca9b028
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294368
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-10 18:34:13 +00:00
Konstantin Shcheglov
255f887df8
Remove ErrorResolverTest.
...
Also I noticed that:
1. I forgot to add FunctionDeclarationStatementResolutionTest.
2. During rebase I forgot to actually remove assertImportPrefix().
Change-Id: Ief08be69c609396c1ab9a4c933fd4017fec70af9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294366
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-10 17:42:24 +00:00
Konstantin Shcheglov
14e45d3772
Replace assertParameterElementType() with textual expectations.
...
Change-Id: I21ab5c6fd3242dfebc78eeda8f95f7570b13d296
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294281
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-10 16:22:28 +00:00
Konstantin Shcheglov
c1dd30c883
Remove assertImportPrefix(), mostly already covered by textual expectations.
...
Change-Id: I46bab535ea70a63d6016b8158092af5ee836bb80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294280
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-10 16:21:59 +00:00
Konstantin Shcheglov
8678473b79
Replace assertPropertyAccess() and friends with textual expectations.
...
Change-Id: I273ec0a55fe9b98c89e10eff473d972697401550
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294282
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-10 03:50:29 +00:00
Konstantin Shcheglov
eadf84b1b8
Replace assertInvokeType() with textual expectations.
...
Change-Id: If39d40071647c76453a4b491c5165044339ecb19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294167
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-07 23:29:05 +00:00
Jake Macdonald
70559a9514
Add support for enums in the macro APIs
...
This includes introspection support, support for annotating and executing macros targeted at enums and enum entries, and support for creating library augmentations of enums with proper syntax (including enum entries).
I also refactored some of the Class support to be more general so we can share interfaces where appropriate.
Change-Id: Ie9111ff280405496e55e32478a19c104341aee37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294100
Commit-Queue: Jake Macdonald <jakemac@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
2023-04-07 19:57:55 +00:00
Konstantin Shcheglov
e6099c86dd
Replace assertNamedType() with textual expectations.
...
Change-Id: I822af19d369c089b1c01bc3eee70a368cc8b84c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-07 18:31:06 +00:00
Konstantin Shcheglov
60d9943ce0
Replace assertUnresolvedSimpleIdentifier() with textual expectations.
...
Change-Id: I1227edbc7935091a652dd8220b90dadb77f72b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294180
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-07 15:44:48 +00:00
Sam Rawlins
0c7c721402
Catch use of optional ctor param via super ctor invocation
...
Fixes https://github.com/dart-lang/sdk/issues/49007
Change-Id: Id2c60fe5a979927f72bdefcf99e98a698b47bf63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-07 02:01:13 +00:00
Konstantin Shcheglov
e945ac6051
Replace assertIdentifierTopGetRef() and friends with textual expectations.
...
Change-Id: I591a5f151d46a4efc3c85299958068a9caedc653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294127
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-06 22:56:06 +00:00
Konstantin Shcheglov
033b567c2a
Replace assertInvokeTypeDynamic() with textual expectations.
...
I decided to remove separate UndefinedSuperMethodTest because the
reported error is just one of the resolution results, in addition to
the resolved AST. So, I think situtations like this should be covered
in resolution tests, and verify everything.
Change-Id: I3b766a6dca6623bbee7586466f7aabf9a5c6e718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294126
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-06 22:11:48 +00:00
Konstantin Shcheglov
6d29fc8d8f
Replace assertSimpleFormalParameter() with textual expectations.
...
Change-Id: I9b89383dee02d245c8ece20a984bf88422b0c3ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294125
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-06 21:41:00 +00:00
Konstantin Shcheglov
c08c443a5e
Replace assertImplicitCallReference() with textual expectations.
...
Change-Id: Ib17b9141d445210c827a0240ffdccf6e9546a959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-06 21:40:04 +00:00
Konstantin Shcheglov
aca1779661
Move annotation resolution tests from AnalysisDriverResolutionTest.
...
Change-Id: Id9cc2e86f7ca36866919152d7bf9fd59827e74be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294123
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-06 20:39:21 +00:00
Daco Harkes
6275efd779
[analyzer/ffi] Error on missing type argument to @Native
...
Also, update error messages to mention `Native` rather than
`FfiNative`, as `FfiNative` syntax is deprecated.
TEST=tests/ffi/regress_51913_test.dart
Closes: https://github.com/dart-lang/sdk/issues/51913
Change-Id: I0830a360bfdd9faffb04761d1ce2da33b380341d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293687
Commit-Queue: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-06 06:26:11 +00:00
Konstantin Shcheglov
81791c9af2
Add 'lateKeyword' to VariableDeclarationList child entities.
...
Change-Id: I29e54a24418a2a3226e908e2082d932941f781df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293401
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-05 16:20:19 +00:00
Paul Berry
e3a18967cc
Patterns parsing: test variable patterns with record types.
...
This already works, but there were no parser tests of it.
Bug: https://github.com/dart-lang/sdk/issues/50912
Change-Id: I2e64b9b4750cf7476df59afd2f9ebc9d66299e40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293580
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2023-04-05 13:17:47 +00:00
Konstantin Shcheglov
f165cbd56e
Remove assertClassRef(), already covered by textual dumps.
...
Change-Id: I9ad5d8617bac21ee099a56fcbefaea5f02129280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293386
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-05 05:10:18 +00:00
Konstantin Shcheglov
192f296307
Replace assertElementName() with textual expectations.
...
No checks for elements, as these are tested in the element model tests.
Change-Id: I217037a165b07a8926c0303e4413f1600387e498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293389
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-05 02:13:37 +00:00
Konstantin Shcheglov
e26aa764a0
Move class alias element constructor tests into element tests.
...
Elements should be tested there, not in resolution tests.
Change-Id: I18819d497c87b0b20b41c04140066424221114ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293388
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-05 02:12:50 +00:00
Konstantin Shcheglov
55974f6f45
Set 'dynamic' as a preliminary type of a JoinPatternVariableElementImpl.
...
So that if we reference to this variable while resolving, and so don't
have the actual type yet, we don't simply crash.
Change-Id: I75538366ca50bf6a292e1f05ddcae2ca57537f8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293464
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-04 23:28:48 +00:00
Konstantin Shcheglov
02a28f3d6e
Remove a few unused methods from ResolutionTest.
...
Change-Id: Iccef305a53b8cd622db6a8c8bbcd6cd079722e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293520
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-04 23:28:39 +00:00
Konstantin Shcheglov
d47cd99310
Report NOT_NAMED_FIELD_IN_OBJECT_PATTERN
...
Change-Id: Iea58d3cef38c07f5fbac0dcbc8984ea727ffd93e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-04 21:36:38 +00:00
Paul Berry
a3f5cfdc7f
Patterns parsing: recover when switch statement syntax used for switch expressions.
...
This change ensure that if the user makes an erroneous switch
expression by imitating the syntax of case statements (i.e. using
`case`, `default`, `:` instead of `=>`, or `;` instead of `,`), error
recovery will understand the user's intent, avoiding follow-on errors.
Fixes #51886 .
Bug: https://github.com/dart-lang/sdk/issues/51886 , https://github.com/dart-lang/sdk/issues/51943
Change-Id: Icd405d4fd4ddfb1aadcf0867e5a51ba898d4cdbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2023-04-04 18:52:59 +00:00
Konstantin Shcheglov
ceaaaa69cf
Replace assertTypeLiteral() with textual expectations.
...
Change-Id: Ib0058fad5824eb7e11c5901056e7778fdbafa76f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293202
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-04 17:48:00 +00:00
Paul Berry
8aa48712be
Patterns parsing: recover from patternVariableDeclaration non-statement.
...
Previously, if a pattern variable declaration appeared outside of a
function or method, the parser would get very confused. Now it
recognizes the situation, issues a comprehensible error message, and
replaces the pattern with a synthetic identifier token so that the
analyzer AST is somewhat sensible.
Fixes #51322 .
Bug: https://github.com/dart-lang/sdk/issues/51322
Change-Id: Ica5f060cb483a39c4e50942d639939b1fab40bea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293087
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2023-04-04 14:55:00 +00:00
Aske Simon Christensen
d1d232776a
[dart2wasm] Rename the dart:wasm library to dart:_wasm.
...
This is an internal library not meant to be used in application code.
CoreLibraryReviewExempt: Changes only Wasm specific libraries.
Change-Id: I2f5b463382d35a442e782067ef7d9063183fe5e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292021
Reviewed-by: Ömer Ağacan <omersa@google.com >
Reviewed-by: Joshua Litt <joshualitt@google.com >
Commit-Queue: Aske Simon Christensen <askesc@google.com >
2023-04-04 11:52:18 +00:00
Johnni Winther
5518abf1c7
[_fe_analyzer_shared] Update non-exhaustive message
...
This updates the message report for non-exhaustive switch statements
and expressions to include the witness in the problem message and
a reduced witness, which doesn't include properties that fully cover the
static type. The message is also split into two messages; one for
switch statements and one for switch expressions, allowing for a
better wording regarding the default/wildcard pattern case.
Change-Id: I17db657ef12ade5d47fa96bf69b8807e33ed5b8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293040
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-04-04 09:44:59 +00:00
Konstantin Shcheglov
227e218262
Replace assertTypeAliasRef() with textual dumps.
...
Change-Id: Ib46a2a63ef2c6ae1429cc3e761ee7c03d29f54e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293086
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-04 06:29:39 +00:00
Konstantin Shcheglov
3bd715fd8a
Replace assertTypeArgumentTypes() with textual dumps.
...
Change-Id: Ib46c00bc82aafde23de75a64f6594614a5633868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293085
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-04 04:36:27 +00:00
Konstantin Shcheglov
647e8f2f89
Replace assertTypeAlias() with textual dumps.
...
Change-Id: I83c3c4c8d39b7ef14bab4f7b26f0230ece136cc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293122
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-04 04:28:59 +00:00
Konstantin Shcheglov
dc0dd51673
Remove assertSuperExpression(), already covered by textual dumps.
...
Change-Id: I1f490f73871e9ec73a1ba3f3cc20a8fdb26da457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293160
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-04 04:28:24 +00:00
Paul Berry
c2713ca752
Patterns parsing: improve error recovery for switch expressions.
...
If the parser gets lost during a switch expression, it now attempts to
pick back up at the next `,` in between the curly braces (ignoring
more deeply nested commas). This allows much better error recovery in
the case where an illegal function expression appears in a guard.
Fixes #51906 .
Bug: https://github.com/dart-lang/sdk/issues/51906
Change-Id: I1cb43857ccc04f0e4146c23c9e07acb02a80d405
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2023-04-04 03:29:39 +00:00
Paul Berry
d78fe25542
Patterns parsing: fix error recovery for switch expression using :
...
If a user attempts to use `:` instead of `=>` in a switch expression,
we now generate an error at the location of each `:` token (and
otherwise interpret the switch expression in the way the user
intended).
Fixes #50930 .
Bug: https://github.com/dart-lang/sdk/issues/50930
Change-Id: I3687fb464b6875424745e664b0d28346b3cd6375
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292982
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2023-04-03 21:28:41 +00:00
Konstantin Shcheglov
db0dfec609
Issue 51893. Report PATTERN_NEVER_MATCHES_VALUE_TYPE in some cases.
...
Bug: https://github.com/dart-lang/sdk/issues/51893
Change-Id: Ia7582df3942a077e81f0343e83359c303d152b1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-03 20:31:45 +00:00
Paul Berry
bf4a94c625
Fix tearoff of methods from promotable variables.
...
Fixes #51853 .
Bug: https://github.com/dart-lang/sdk/issues/51853
Change-Id: I407a1d5fb8b00f983cfcf106d1f569d0642058c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292764
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2023-04-03 19:39:59 +00:00