Change-Id: If31c487e3ebe2c1ae847aff7c8994580b8b6f2f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309660
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
State more explicitly that sealed classes are abstract and lead the
user to a better fix with the error message.
Bug: https://github.com/dart-lang/sdk/issues/52073
Change-Id: Id24c6cb187ee5497ca2819f930c48ff5aa8d07fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296025
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
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>
Then when using a final class in an on clause outside of its library, we don't produce a base/final subtype error.
Change-Id: Ib96efefb04639496daeee0de98c5711e73709ac5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291591
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Also, when using a final class in an on clause outside of its library, we don't produce a base/final subtype error.
Change-Id: I6600bc136ca37e98f9698c604214a6c565d6a9af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Updated corresponding language tests. No new behaviour, updated test messages and location.
Change-Id: Ib3c7e2d701bdfbb68757c532b945348f6cbebad0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
It is an error to mix in a class declaration that does not have the 'mixin' modifier, outside of its library for class declarations in a library version lower than sealed class' release version.
Change-Id: I318bb243705748eae60482b6c3513669f1cbb90c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
From the changes in dart-lang/language#2674 that specify from a certain language version, we would like classes to not be used as mixins unless specified as a 'mixin class'.
Currently, this behaviour is under the sealed-class flag. May be subject to change as the other modifiers are added, but I'd at least like to make sure this works for sealed classes.
Change-Id: I5754b383327dde06d49175fe2d05c8ba7462145f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273082
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Implements the behaviour discussed in dart-lang/language#2600. All other mixin application or implementing behaviour for sealed families should be unaffected.
Change-Id: I95577d8b2bc69e6c1a365ec43fb156f5d5d9a259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272461
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Special syntax for mixin applications should be also abstract if we add the sealed modifier.
Change-Id: I3af3e997734f4bc762dc29bfc3f61f2e691ca41b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
`sealed` and `abstract` modifiers are mutually exclusive. Error when a user tries to use them together on a class declaration.
Implemented in the parser since it's a common error between the analyzer and the CFE.
Change-Id: I9a8835c29ddb430ea0f005630bbdf9348f8b055c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Basic support for the `sealed` keyword and added a few tests.
Change-Id: I5adedda22b1e8ce6d4b61136ad8e6d38bdf05043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268366
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Basic language tests that test usage in and out of library for sealed classes.
More tests will come later.
Change-Id: I298484d214a5fe7602d14ab1d7915c733ef00c34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265660
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>