forked from dart-lang/co19
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dart-lang#2559. Add augmenting types tests. Part 1
- Loading branch information
Showing
6 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t01.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,29 @@ | ||
// 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 It is a compile-time error if: | ||
/// | ||
/// - The augmenting type and corresponding type are not the same kind: class, | ||
/// mixin, enum, or extension. You can't augment a class with a mixin, etc. | ||
/// | ||
/// @description Checks that it is a compile-time error if an augmenting type | ||
/// and the corresponding type are not the same kind | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import augment 'augmenting_types_A01_t01_lib1.dart'; | ||
import augment 'augmenting_types_A01_t01_lib2.dart'; | ||
|
||
class C {} | ||
|
||
mixin M {} | ||
|
||
enum E {e1;} | ||
|
||
main() { | ||
print(C); | ||
print(M); | ||
print(E); | ||
} |
31 changes: 31 additions & 0 deletions
31
LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t01_lib1.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,31 @@ | ||
// 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 It is a compile-time error if: | ||
/// | ||
/// - The augmenting type and corresponding type are not the same kind: class, | ||
/// mixin, enum, or extension. You can't augment a class with a mixin, etc. | ||
/// | ||
/// @description Checks that it is a compile-time error if an augmenting type | ||
/// and the corresponding type are not the same kind | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'augmenting_types_A01_t01.dart'; | ||
|
||
augment mixin C {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
augment class M {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
augment class E {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |
31 changes: 31 additions & 0 deletions
31
LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t01_lib2.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,31 @@ | ||
// 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 It is a compile-time error if: | ||
/// | ||
/// - The augmenting type and corresponding type are not the same kind: class, | ||
/// mixin, enum, or extension. You can't augment a class with a mixin, etc. | ||
/// | ||
/// @description Checks that it is a compile-time error if an augmenting type | ||
/// and the corresponding type are not the same kind | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'augmenting_types_A01_t01.dart'; | ||
|
||
augment enum C {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
augment enum M {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
augment mixin E {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |
33 changes: 33 additions & 0 deletions
33
LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t02.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,33 @@ | ||
// 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 It is a compile-time error if: | ||
/// | ||
/// - The augmenting type and corresponding type are not the same kind: class, | ||
/// mixin, enum, or extension. You can't augment a class with a mixin, etc. | ||
/// | ||
/// @description Checks that it is a compile-time error if an augmenting type | ||
/// and the corresponding type are not the same kind. Test type aliases | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import augment 'augmenting_types_A01_t02_lib1.dart'; | ||
import augment 'augmenting_types_A01_t02_lib2.dart'; | ||
|
||
class C {} | ||
|
||
mixin M {} | ||
|
||
enum E {e1;} | ||
|
||
typedef CAlias = C; | ||
typedef MAlias = M; | ||
typedef EAlias = E; | ||
|
||
main() { | ||
print(CAlias); | ||
print(MAlias); | ||
print(EAlias); | ||
} |
31 changes: 31 additions & 0 deletions
31
LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t02_lib1.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,31 @@ | ||
// 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 It is a compile-time error if: | ||
/// | ||
/// - The augmenting type and corresponding type are not the same kind: class, | ||
/// mixin, enum, or extension. You can't augment a class with a mixin, etc. | ||
/// | ||
/// @description Checks that it is a compile-time error if an augmenting type | ||
/// and the corresponding type are not the same kind. Test type aliases | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'augmenting_types_A01_t02.dart'; | ||
|
||
augment mixin CAlias {} | ||
// ^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
augment class MAlias {} | ||
// ^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
augment class EAlias {} | ||
// ^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |
31 changes: 31 additions & 0 deletions
31
LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t02_lib2.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,31 @@ | ||
// 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 It is a compile-time error if: | ||
/// | ||
/// - The augmenting type and corresponding type are not the same kind: class, | ||
/// mixin, enum, or extension. You can't augment a class with a mixin, etc. | ||
/// | ||
/// @description Checks that it is a compile-time error if an augmenting type | ||
/// and the corresponding type are not the same kind. Test type aliases | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'augmenting_types_A01_t02.dart'; | ||
|
||
augment enum CAlias {} | ||
// ^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
augment enum MAlias {} | ||
// ^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
augment mixin EAlias {} | ||
// ^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |