Commit Graph

16 Commits

Author SHA1 Message Date
Robert Nystrom 361cf93984 Reformat tests/language/a-e using 3.8 style.
Change-Id: I5cfab9212bb78809967de323b60ebb06913b84d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425149
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2025-04-29 07:38:43 -07:00
Robert Nystrom 6cc9efe290 Reformat tests/language/c*.
Change-Id: I94dfcea40566190c6bf153c108b0d0d5dbf27a4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400148
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2024-12-12 15:50:08 -08:00
Konstantin Shcheglov 21cfe2ce61 Breaking changes for analyzer version 6.0.0
Change-Id: I792c3d66fb10ab779e2a5011b2909efa5738aba7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265183
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-16 16:31:27 +00:00
Sergey G. Grekhov 82b78916fd [tests] Remove obsolete Dart 3.0 experiments from language tests
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>
2023-06-15 08:26:27 +00:00
Kallen Tu 0b03e711bf [cfe] Change error message for mixin subtype restriction.
Make better error message for mixins since they can't be final nor
sealed.

Bug: https://github.com/dart-lang/sdk/issues/52697
Change-Id: I56a9cb66131c0a47ea1c91b95dcf70d12835134e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308964
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-06-14 14:28:48 +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
Kallen Tu 6779635eb0 [cfe] Only report base/final subtype errors on the nearest problematic subtype.
To match up with analyzer behaviour, we want to only report subtype errors
on the first erroneous subtype instead of every subtype down the tree.

Change-Id: Ifb93ef39498e93d075a475fff8939017b563414e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291344
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-28 19:07:57 +00:00
Kallen Tu fd1b48d82e [tests] Remove interface mixin, final mixin, and sealed mixin from language tests.
Change-Id: I8d92758c3a43ed0eff2e0c953ae8a87e65a3a920
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291047
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-03-24 23:04:47 +00:00
Kallen Tu fde66e95bd [analyzer] Mark induced modifiers on sealed types.
Changed the classes to store induced modifiers on `isBase`, `isFinal`, and `isInterface`. If one of these getters are true and `isSealed` is true, then we assume it's an induced modifier. (Since a class or mixin cannot be both sealed and another modifier).

There's a subtle change here where the induced modifiers are only marked on sealed classes which means that classes that subclass/subtype non-sealed classes won't get any base or final errors. This will also affect how lints will be reported -- at the next erroneous subtype and not downstream from that type.

Also, the context messages now point to the class with the explicit modifier inciting the error.

Bug: #51671

Change-Id: I4c7541d956382dcb3917a4b8d73756840880c52f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289406
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-03-20 22:26:26 +00:00
Kallen Tu 22de5b34f2 [cfe] Report an error when a subtype of a base or final type is not base, final or sealed.
Change-Id: I54c9e3edcc0ae7e61f48ff7e3b42d83e0556af7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286101
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-01 19:10:56 +00:00
Kallen Tu 4f6ccd9fee [analyzer] Report an error when a subtype of a base or final type is not base, final or sealed.
Change-Id: Ie9c943e6ce7d3b1c746ccd4ee3757886dd619c5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-01 19:01:59 +00:00
Kallen Tu 9c86cb80bb [tests] Update language tests with base/final subtyping loophole fixed and a few enum tests.
Change-Id: Id30bbdc4b6eedf0751f725024acbed812a07a4fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280860
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-02-07 03:01:27 +00:00
Kallen Tu 6ee64808ce [cfe] Refactor error handling for all existing class modifier behaviour.
Change-Id: I925f008ef3a1522c4e60f283dbdbd0fb5b1e290c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280049
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-01 20:08:50 +00:00
Kallen Tu f48a1fb3da [analyzer] Report error when implementing a base class.
Change-Id: Ia55354350451849a112a32bb048a4fcbe5afe1b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279655
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-01-26 22:15:57 +00:00
Kallen Tu 7cf49ba433 [cfe] Report error when implementing a base class.
Change-Id: Iff3c31b4883d3d4fc4c392c6ac8207617ce65761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279648
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-01-26 16:01:55 +00:00
Kallen Tu 1e39261b4a [tests] Language tests for 'base' class modifier.
Change-Id: I2b5cf3d2d367d0cfd2d2da60268b36f16225ab1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276762
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-01-09 22:29:14 +00:00