Commit Graph

13070 Commits

Author SHA1 Message Date
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
Keerti Parthasarathy 90c434254f Add support for patterns for Add type quick fix
Bug: 51866
Change-Id: Id38d0c8405931cad057ec3db1e0c0e3d297d7b4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-04-14 20:09:52 +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
Konstantin Shcheglov 63fd5aa364 Issue 52014. Make an implicit name of a named PatternField explicit when the pattern variable is renamed.
Bug: https://github.com/dart-lang/sdk/issues/52014
Change-Id: Ifcc8ba255cb536cba11360ef4326525c1e037b44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-13 21:02:37 +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
William Hesse 7bac8ed687 [Release] Bump minor version of main to version 3.1.
Change-Id: Icf489686d790be195e37db37727782227d2f3704
TEST=Version bump autogenerated by scripts
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294600
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-04-12 16:36:20 +00:00
Lasse R.H. Nielsen 80de9162c8 Retire 2.19 experiment.
Tested: No tests. Removing functionality, all existing tests running is a success.
Change-Id: I25eb84347e1d133d465671223f4d3b037116c5e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294241
Reviewed-by: Liam Appelbe <liama@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-04-12 12:46:41 +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
pq 98014e0e2e fixed dangling library doc comments
Change-Id: I28f5cd8ae31cb7b69da09028d0328e9f6c76bb69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294681
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-04-12 00:29:48 +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
Kallen Tu 7906ccf7ea [analyzer] Start using IndexError.check in library_element.
Reverses https://dart-review.googlesource.com/c/sdk/+/269141.
Now that the pubspec specifies 2.19 as the minimum version, we can
swap to IndexError.check instead of checkValidIndex.

Change-Id: I0dab64b4c8408a29b8bea35920e3f5e69e6e92d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294124
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-04-06 23:12:58 +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
Konstantin Shcheglov b1c0f16a51 Issue 51961. Suggest getter names inside pattern of named PatternField without name, inside RecordPattern.
Bug: https://github.com/dart-lang/sdk/issues/51961
Change-Id: I33b499829887dc221c2d18fe4586ec08207c026f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293863
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-06 19:55:08 +00:00
Zach Anderson 4919729f00 Revert "Reland "[pkg:js/dart:js_interop] Move annotations to dart:_js_annotations""
This reverts commit 9e1997971e.

Reason for revert: Breaks Dart -> Engine roll?

See:
https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20linux_web_engine/1821/overview
https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20Engine%20Drone/666824/overview

Original change's description:
> Reland "[pkg:js/dart:js_interop] Move annotations to dart:_js_annotations"
>
> This is a reland of commit fbe9c21972
>
> This fixes the issue with the duplicate allowPlatformPrivateLibraryAccess.
>
> Original change's description:
> > [pkg:js/dart:js_interop] Move annotations to dart:_js_annotations
> >
> > This moves package:js annotations to the internal library that
> > Flutter has been using already. This gives us a single location
> > for all package:js annotations. We also introduce a @JS annotation
> > in dart:js_interop since we can no longer use dart:_js_annotations
> > to avoid the breaking change in semantics.
> >
> > CoreLibraryReviewExempt: Backend-specific internal library.
> > Change-Id: I9ca55c807d7d192004a6da99f63a72d598fe4f12
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284760
> > Commit-Queue: Srujan Gaddam <srujzs@google.com>
> > Reviewed-by: Samuel Rawlins <srawlins@google.com>
> > Reviewed-by: Johnni Winther <johnniwinther@google.com>
> > Reviewed-by: Joshua Litt <joshualitt@google.com>
>
> CoreLibraryReviewExempt: Relanding.
> Change-Id: I40ff2a00682fccbd7dd44a364b5046aaac0f3bac
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293203
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>

Change-Id: Ide8609575c73d714f3ae4f9ea9ffc74e228fa189
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293962
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2023-04-06 14:43:18 +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
Srujan Gaddam 9e1997971e Reland "[pkg:js/dart:js_interop] Move annotations to dart:_js_annotations"
This is a reland of commit fbe9c21972

This fixes the issue with the duplicate allowPlatformPrivateLibraryAccess.

Original change's description:
> [pkg:js/dart:js_interop] Move annotations to dart:_js_annotations
>
> This moves package:js annotations to the internal library that
> Flutter has been using already. This gives us a single location
> for all package:js annotations. We also introduce a @JS annotation
> in dart:js_interop since we can no longer use dart:_js_annotations
> to avoid the breaking change in semantics.
>
> CoreLibraryReviewExempt: Backend-specific internal library.
> Change-Id: I9ca55c807d7d192004a6da99f63a72d598fe4f12
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284760
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Joshua Litt <joshualitt@google.com>

CoreLibraryReviewExempt: Relanding.
Change-Id: I40ff2a00682fccbd7dd44a364b5046aaac0f3bac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293203
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-04-05 23:20:15 +00:00
Konstantin Shcheglov 7ba94c9202 Issue 51961. Suggest getter names inside pattern of named PatternField without name, inside ObjectPattern.
Bug: https://github.com/dart-lang/sdk/issues/51961
Change-Id: Ibd6f762f4e363f26daaca21515a9c23c748f8cc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-05 22:47:19 +00:00
Brian Wilkerson 906c1e92c4 Mark new docs as being published
Change-Id: I84ddb4e3625d65ea4d69c591b29ef4a51b396356
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293745
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-05 19:42:39 +00:00
Keerti Parthasarathy a02f252ef1 Revert "Add support for patterns for Add type quick fix"
This reverts commit f4773e49c0.

Reason for revert: Breaks server tests
Original change's description:
> Add support for patterns for Add type quick fix
>
> Bug:51866
> Change-Id: I42d4443c38fc7708a2b174a80b689adfc0a37aaa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293460
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

Bug: 51866
Change-Id: I5d1f933fa7b88495f941b30001873c33206975f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293820
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-05 18:13:37 +00:00
Keerti Parthasarathy f4773e49c0 Add support for patterns for Add type quick fix
Bug:51866
Change-Id: I42d4443c38fc7708a2b174a80b689adfc0a37aaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-05 17:53:59 +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
Brian Wilkerson 1eecd779c3 Add documentation for a last minute diagnostic
Change-Id: I798269bcfad348ec763abb23b553f3d4dae3af69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293383
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-05 03:21:09 +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