-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Update augmenting libraries tests according #2583
- Loading branch information
Showing
4 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
LanguageFeatures/Augmentation-libraries/augmenting_types_A06_t09.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion A class, enum, extension type, or mixin augmentation may specify | ||
/// extends, implements, on, and with clauses (when generally supported). The | ||
/// types in these clauses are appended to the original declarations clauses of | ||
/// the same kind, and if that clause did not exist previously then it is added | ||
/// with the new types. All regular rules apply after this appending process, so | ||
/// you cannot have multiple extends on a class, or an on clause on an enum, etc | ||
/// | ||
/// @description Checks that a mixin augment may specify an `on` clause and it | ||
/// is a compile-time error to create a mixin application that doesn't take into | ||
/// account this augment | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import augment 'augmenting_types_A06_t09_lib.dart'; | ||
|
||
class A {} | ||
class C {} | ||
mixin M on A {} | ||
|
||
class BadMA1 = A with M; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class BadMA2 = C with M; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
print(BadMA1); | ||
print(BadMA2); | ||
} |
21 changes: 21 additions & 0 deletions
21
LanguageFeatures/Augmentation-libraries/augmenting_types_A06_t09_lib.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion A class, enum, extension type, or mixin augmentation may specify | ||
/// extends, implements, on, and with clauses (when generally supported). The | ||
/// types in these clauses are appended to the original declarations clauses of | ||
/// the same kind, and if that clause did not exist previously then it is added | ||
/// with the new types. All regular rules apply after this appending process, so | ||
/// you cannot have multiple extends on a class, or an on clause on an enum, etc | ||
/// | ||
/// @description Checks that a mixin augment may specify an `on` clause and it | ||
/// is a compile-time error to create a mixin application that doesn't take into | ||
/// account this augment | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
augment library 'augmenting_types_A06_t09.dart'; | ||
|
||
augment mixin M on C {} |