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
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
9c34ff75db
[analyzer] Produce error when omitting base/final/sealed on base/final superclasses through legacy libraries.
...
When a post-feature library implements a pre-feature library declaration that has a final core library class as a super declaration, it should not produce a base/final/sealed transitivity error. Subclasses of a base core library class will still emit this error.
Otherwise, if base/sealed/final is omitted in a non-implement case, we want to report these errors.
Bug: https://github.com/dart-lang/sdk/issues/52315
Change-Id: Icdd4f63f69b061be5eabc7fd30b703d0358018a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302365
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2023-05-10 22:05:59 +00:00
Kallen Tu
ea21df9dbe
[cfe] Disallow implementing a legacy library subclass of a final/base class in the core libraries.
...
This behaviour should only happen when a post-feature library implements
a pre-feature library declaration that has a final/base core library class as a super declaration.
Bug: https://github.com/dart-lang/sdk/issues/52115
Change-Id: If42129ba3ba7e337cc6ffc21604c6d0f2976344c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301503
Reviewed-by: Nate Bosch <nbosch@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2023-05-10 14:31:50 +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
Kallen Tu
95565e28e2
[tests] Language tests for errors when implementing a 2.19 class that implements a core library base or final class.
...
Bug: https://github.com/dart-lang/sdk/issues/52078
Change-Id: If97895b9560475f11e8236de87ad5880bdee97c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300880
Reviewed-by: Lasse Nielsen <lrn@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2023-05-04 20:53:42 +00:00
Leaf Petersen
806ba0a0ca
Update base transitivity error messages for the CFE.
...
Change-Id: I036d17deb110559b35c043e1cd660dbcafffed1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300324
Auto-Submit: Leaf Petersen <leafp@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Kallen Tu <kallentu@google.com >
2023-05-02 18:23:49 +00:00
Johnni Winther
2a82ba0f48
[cfe] Report error on indirect implementation of base class
...
Closes #52161
Change-Id: I9e2f441036cfeeb904a3e3ec5aeff2e5c45cb8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298160
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2023-04-26 08:16:34 +00:00
Leaf Petersen
5138a1eb38
Add test cases to cover implementing a base declaration from the
...
current library which itself extends a base declaration from another
library.
Change-Id: I3caf125de528d5c082c825c02055a114f732f385
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298040
Commit-Queue: Leaf Petersen <leafp@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
Reviewed-by: Lasse Nielsen <lrn@google.com >
2023-04-25 21:59:46 +00:00
Kallen Tu
f76f84c850
[cfe] Report error when sealed or final used in on type outside of library.
...
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 >
2023-03-29 12:09:23 +00:00
Kallen Tu
e0ab0d1be5
[analyzer] Report error when sealed or final used in on type outside of library.
...
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 >
2023-03-27 22:33:29 +00:00
Leaf Petersen
386825ee8c
Add tests for the transitivity of the base modifier when applied to
...
base mixins and base mixin classes.
Change-Id: Idfe7576f38382c5e9a0ff968aae00f48990e1d38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290351
Commit-Queue: Leaf Petersen <leafp@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
2023-03-24 21:59:23 +00:00
Kallen Tu
24d210a18c
[tests] Fix existing on clause tests for final classes.
...
Disallow using final classes on on-clauses outside of its library.
Update tests to show this behaviour. (Or at least in a state where I can test out the implementation)
Change-Id: I74306c873dbd047c6b94d8e8e75c215562dd9483
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290915
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Leaf Petersen <leafp@google.com >
2023-03-24 18:07:52 +00:00
Kallen Tu
2e19faaec9
[cfe] Report an error when implementing a base class through a sealed class.
...
Bug: https://github.com/dart-lang/sdk/issues/51811
Change-Id: Ifad0519332965d79719173702293b48e94231024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291040
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2023-03-24 17:09:09 +00:00
Kallen Tu
66c1b0db50
[analyzer] Report an error when implementing a base class through a sealed class.
...
Bug: https://github.com/dart-lang/sdk/issues/51810
Change-Id: I478eff8484fa5d3bddfb9cf1c744e6d65a72f6c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2023-03-23 22:06:01 +00:00
Kallen Tu
c7cee7fd46
[tests] Update tests where analyzer mixin applications were failing.
...
Bug: https://github.com/dart-lang/sdk/issues/51808
Change-Id: I0c3951ab28f96cf1794e0ac1088c975c11935bf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290660
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Leaf Petersen <leafp@google.com >
2023-03-22 22:51:34 +00:00
Leaf Petersen
da7ef9a661
Tests for transitivity of base.
...
Test that all subtypes of classes marked base/final are required to be
base/final/sealed, and that base/final classes may not be implemented
outside of their own library. Also test restrictions on sealed and
interface classes.
Change-Id: I15314a34b684bbec5a16b8ae228ca7de08f8498a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290100
Reviewed-by: Erik Ernst <eernst@google.com >
2023-03-21 20:31:00 +00:00