Chloe Stefantsova
40d99bc981
[cfe] Remove extra conditions on await-for in non-async body check
...
Additionally, report the error on the 'await' keyword instead of 'in'
Change-Id: I0ccd156f19997eb18b5df004a75f86e616b23864
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301021
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2023-05-09 06:56:44 +00:00
Kallen Tu
6de1afdb3a
[analyzer] Disallow implementing a legacy library subclass of a final class.
...
Checks an interface's supertypes for final classes and produces an error if the implementing bypasses a legacy library.
This behaviour should only happen when a post-feature library implements
a pre-feature library declaration that has a final class as a super
declaration.
Similar error to https://dart-review.googlesource.com/c/sdk/+/298320
Bug: https://github.com/dart-lang/sdk/issues/52078
Change-Id: Ie16edb2b231957dad7502fdab3d5faba93bc6773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300861
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2023-05-08 23:16:53 +00:00
Konstantin Shcheglov
1e626dc929
Issue 52306. Don't report UNNECESSARY_IMPORT when deprecated exports.
...
Bug: https://github.com/dart-lang/sdk/issues/52306
Change-Id: I20a36ea355df463857b56cb05bcef0ef72f6850d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302080
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-08 19:50:29 +00:00
Konstantin Shcheglov
2e6bdc29de
Add InvalidType, InvalidTypeImpl, but don't resolve to it yet.
...
I ran the CL that does resolve with it in google3, it is mostly
green, but there are a few clients that extend TypeVisitor directly.
So, I want to publish the interface `InvalidType` first, update the
clients, and only then update the resolution.
Bug: https://github.com/dart-lang/sdk/issues/36697
Change-Id: I1f1c995a36849ebbde2c526bb8761d86be87b4ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-08 19:48:03 +00:00
Paul Berry
3713c0e264
Patterns parser: prohibit variable/identifier patterns named when/as.
...
In https://dart-review.googlesource.com/c/sdk/+/299400 , the parser was
adjusted so that it no longer accepts `when` and `as` as the names for
variable patterns in cases where there is a possible ambiguity
(e.g. `int when` is not accepted as a pattern because `int` is a
legitimate pattern, therefore `when` could introduce a guard
clause). This change further prohibits `when` and `as` from being the
names of variable patterns or identifier patterns even in the case
where there is no ambiguity. This is in line with the discussion at
https://github.com/dart-lang/sdk/issues/52199#issuecomment-1526297771 ,
and the spec change at
https://github.com/dart-lang/language/pull/3033 .
Three new error codes are introduced, to cover the three circumstances
in which `when` or `as` might be used illegally: in a declared
variable pattern, in an assigned variable pattern, or in an identifier
pattern. I've also added analyzer tests to ensure that the parser
recovers from these errors nicely. Unfortunately, nice error recovery
is only feasible in the non-ambiguous cases.
I've also updated the language test expectations in
`tests/language/patterns/version_2_32_changes_error_test.dart` to
reflect the new error messages, and added a few more examples of uses
of `when` and `as` that are still permitted.
Fixes #52260 .
Bug: https://github.com/dart-lang/sdk/issues/52260
Change-Id: I229f627aa639659c30b83c74895759207da279f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301482
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2023-05-08 19:06:02 +00:00
Konstantin Shcheglov
757d9ae199
Issue 52280. Use the URI as LibraryElement.toString()
...
Bug: https://github.com/dart-lang/sdk/issues/52280
Change-Id: I15fa5a9cdc2017d91f6d75da17430c060624695e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301726
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-08 15:41:23 +00:00
Konstantin Shcheglov
44ba2eba08
Issue 52258. Ignore 'int' and 'double' pairs, are the same in JavaScript.
...
Bug: https://github.com/dart-lang/sdk/issues/52258
Change-Id: I01f167bf597f11cb8dec7864c3074d16ad44c2d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301725
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-08 15:39:52 +00:00
Konstantin Shcheglov
036b8cafad
Add AnalysisError.tmp() constructor, deprecate the default one.
...
Bug: https://github.com/dart-lang/sdk/issues/51985
Change-Id: I1204c71a4c5ea62d32d65662ecb5274dacb0bfae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301730
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-08 14:39:29 +00:00
Konstantin Shcheglov
f572144809
Issue 52271. Report FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY when via library before class-modifiers.
...
Bug: https://github.com/dart-lang/sdk/issues/52271
Change-Id: I94049f8702647fc604c42ce353afce9d19322d8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301506
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-05-06 17:16:28 +00:00
Konstantin Shcheglov
f90c3d0423
Issue 52272. Report DEPRECATED_MIXIN_FUNCTION in more places.
...
Bug: https://github.com/dart-lang/sdk/issues/52272
Change-Id: I02133f8685adf6a1e4fa16288948cc31afeb1bd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301560
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-05 20:02:28 +00:00
Konstantin Shcheglov
4d6f49b1cd
Update ExtensionOverride to use ImportPrefixReference and name token.
...
Change-Id: Ifc5852c775a95908992d33a7949b4f4bea396d66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-05-05 15:42:36 +00:00
Konstantin Shcheglov
40de1ab1ab
Issue 46514. Report an error for using extension methods in a prefix or binary constant expressions.
...
Bug: https://github.com/dart-lang/sdk/issues/46514
Change-Id: I59ed3bd754043302632f31aedeaedd7824b8a8c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301505
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-05 02:31:19 +00:00
Konstantin Shcheglov
f8eb704f4e
Rename to NamedTypeResolutionTest.
...
Change-Id: I6e840177e343d9cf08c3a18226849749a067aa7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Keerti Parthasarathy <keertip@google.com >
2023-05-01 18:02:09 +00:00
Konstantin Shcheglov
ec330b47de
Deprecate 'DartType.isDynamic', use 'is DynamicType' instead.
...
Change-Id: Ia3660a0d38f01a590dd3e034f40dbdb5a432638a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300042
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-01 16:09:08 +00:00
Konstantin Shcheglov
e4d754d5b6
Issue 47915. Don't build DefaultParameterElementImpl for formal parameters that are not allowed to have default values.
...
Bug: https://github.com/dart-lang/sdk/issues/47915
Change-Id: I708775ca29bf9efdfdf798eb4b622f1308f2b00c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300140
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-01 16:05:48 +00:00
Konstantin Shcheglov
4756d077ed
Update NamedType to use ImportPrefixReference and name token.
...
Using Identifier expression inside NamedType does not make sense.
Change-Id: I4a61d2b472fd66fb7c5e6e92a80cccb391b06d49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-28 17:31:46 +00:00
Paul Berry
637dd76c7f
Patterns parsing: fix ambiguity resolution for when and as.
...
This change fixes parsing of case clauses such as:
case foo when !flag:
Constructions like this require some lookahead in order to parse
correctly, because the token `when` is valid both as an identifier and
as a part of the grammar for a case clause. Therefore, at the time
`foo` is encountered, the parser must decide whether it is looking at
a variable pattern (`foo when`, where `when` is the name of the
variable) or an identifier pattern (`foo`, where `when` begins the
case's guard clause). Previous to this fix, the algorithm for
disambiguating these two choices was as follows:
- If the token sequence starting at `foo` looked like a type, and the
token that follows was an identifier, the parser assumed it was
looking at a variable pattern with a type; otherwise it assumed it
was looking at an identifier pattern.
- EXCEPT that if the token that followed the supposed type was `when`
or `as` (both of which are valid identifiers), then it probed
further:
- If the token that followed `when` or `as` was a token that could
legitimately follow a pattern, then it assumed that it was looking
at a variable pattern with a type. (The tokens that could
legitimately follow a pattern are `,`, `:`, `||`, `&&`, `)`, `}`,
`]`, `as`, `when`, `?`, `!`).
- Otherwise it assumed that it was looking at an identifier pattern.
This didn't fully disambiguate, because the third bullet didn't
account for the fact that the tokens `as`, `when`, and `!` could
_either_ legitimately follow a pattern _or_ legitimately begin an
expression (or, in the case of `when`, a type), therefore constructs
like the following were incorrectly parsed:
- `case foo when as:` (where `as` is a local boolean variable)
- `case foo when when:` (where `when` is a local boolean variable)
- `case foo when !flag:` (where `flag` is a local boolean variable)
- `case foo as when:` (where `when` is the name of a type)
The solution is to simplify the disambiguation logic so that if if the
token that follows the supposed type is `when` or `as`, then the
parser assumes that it's looking at an identifier pattern, _not_ a
typed variable pattern.
The consequence of this is that the above four constructions are
parsed correctly; however it is no longer possible for a typed
variable pattern to name a variable `when` or `as`.
For consistency we would like to prohibit _any_ variable pattern from
naming a variable `when` or `as`, however to keep this change as small
as possible (and reduce the risk involved in a possible cherry-pick)
that will be postponed until a later CL.
Fixes #52199 .
Bug: https://github.com/dart-lang/sdk/issues/52199
Change-Id: Ibab9b92f01e3e4020d7d64f1ff000a9b964a4564
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299400
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2023-04-28 13:22:28 +00:00
Konstantin Shcheglov
7f503e3688
Issue 52202. Fix crash when object pattern type is potentially nullable.
...
Bug: https://github.com/dart-lang/sdk/issues/52202
Change-Id: I54068a58f68f46c3d75c1586e6ed575b361a22fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299380
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2023-04-28 03:20:39 +00:00
Konstantin Shcheglov
0f4275a443
Issue 52197. Remove null assert from getEnumElementValue()
...
I see a crash like this from external users.
Bug: https://github.com/dart-lang/sdk/issues/52197
Change-Id: I5b18552ae1db50c7a103ee6b04f36d0ade8c6f5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299180
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-27 21:22:48 +00:00
Konstantin Shcheglov
d838d1a08a
Issue 52191. It is not an error to use a void typed expression in SwitchExpressionCase.
...
Bug: https://github.com/dart-lang/sdk/issues/52191
Change-Id: I2cea3260ad63a0c59399f02dadb99bb09a944623
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299200
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-27 21:22:29 +00:00
Konstantin Shcheglov
c13acbf1dd
Issue 52136. Report USE_OF_VOID_RESULT for SwitchExpression.
...
Bug: https://github.com/dart-lang/sdk/issues/52136
Change-Id: I3a3b8f45419c57deec77deae37cd5f98481debeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-26 16:12:48 +00:00
Konstantin Shcheglov
80d26df2fd
Issue 52160. Report BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY for implementing 'base' via 'extends'.
...
Bug: https://github.com/dart-lang/sdk/issues/52160
Change-Id: I47a72021a002663d04fd8ea14c11a012917e8a8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-25 20:19:38 +00:00
Konstantin Shcheglov
79bf3eedd6
Run UseOfVoidResultTest with null safety enabled.
...
Bug: https://github.com/dart-lang/sdk/issues/52136
Change-Id: I0a77a81d0a558e8b2450e91e6156d5fab03579a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298300
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-25 20:14:08 +00:00
Konstantin Shcheglov
00d841ee99
Issue 52060. Fix reporting CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE for Null vs. nullable FunctionType.
...
Bug: https://github.com/dart-lang/sdk/issues/52060
Change-Id: I5373a9a73396fbf49562131f5f801d1bceeb65f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298280
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-25 20:09:28 +00:00
Konstantin Shcheglov
b81fd66ed5
Issue 52164. Include enums and mixins into types of a sealed class.
...
Bug: https://github.com/dart-lang/sdk/issues/52164
Change-Id: Icd6ac232d6356b7e05995b79e5f7d8b33b88a719
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298260
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-25 20:01:52 +00:00
Konstantin Shcheglov
018dadcf5b
Resolve the whole unit in resolveForCompletion() when the node is a directive.
...
There is a quite complicated logic in resolving directives and walking
augmentations and parts. And we don't expect users write a lot of code
in directives, so there is less need for optimizations than when typing
in method bodies.
Change-Id: Id38e90f09eb5c1e84be8fc28ed4211d03762d2e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-25 20:01:25 +00:00
Konstantin Shcheglov
903be31b05
Apply nullabilitySuffix to interfaces / mixins / superclassConstraints / superclass.
...
Bug: https://github.com/dart-lang/sdk/issues/52133
Change-Id: Ib32d10d7736c59f93fdb1d6eb79851f3e44457b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297400
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-24 17:56:40 +00:00
Konstantin Shcheglov
529adda42e
Issue 52131. Find implicit constructor invocations from other constructors.
...
Bug: https://github.com/dart-lang/sdk/issues/52131
Change-Id: I7f28e4664f18196f978cb9dd38f878b1240d46a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297080
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-21 22:04:16 +00:00
Konstantin Shcheglov
d84f9dca32
Ensure that ExecutableMember.returnType uses the same type parameters.
...
Change-Id: I72d900da7e0d6b791e7801af72961cf4c23c4fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-19 19:01:57 +00:00
Konstantin Shcheglov
dc34fe9f86
Deprecate IfElement/IfStatement.condition, use 'expression'.
...
Change-Id: If43b4b71a21fd256ce8d1367d4b233e1cff764b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296122
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Nate Bosch <nbosch@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-19 17:17:28 +00:00
Konstantin Shcheglov
ad30add7a3
Don't use PubWorkspace for 'third_party/dart' locations.
...
These should be treated as BlazeWorkspace.
Bug: https://buganizer.corp.google.com/issues/273584249
Change-Id: Id7bf03d14d3304eb062be0d539cfac0c282ecec6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-19 17:16:51 +00:00
Konstantin Shcheglov
000655e4d3
Support sealed classes in canBeSubtypeOf()
...
Bug: https://github.com/dart-lang/linter/issues/4280
Change-Id: Iab92670d7c5db535968b4fe4ac26a5777e1bf6ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295801
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-04-18 20:02:58 +00:00
Sam Rawlins
25348fb95c
[analyzer] Move 2 more HintCodes to be WarningCodes, UNNECESSARY_*
...
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Iddcb1b6d035e9590600e6bfbd8d2133da39bcc35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295803
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2023-04-18 16:55:30 +00:00
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