diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t01.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t01.dart new file mode 100644 index 0000000000..1c9cf90cce --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t01.dart @@ -0,0 +1,22 @@ +// 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 library referenced in an `import augment` directive is not an +/// augmentation and does not have a `library augment` directive. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `import augment` directive is not an does not have a `library augment` +/// directive +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +import augment 'applying_augmentation_library_A01_t01_lib.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t01_lib.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t01_lib.dart new file mode 100644 index 0000000000..9a6c09d385 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t01_lib.dart @@ -0,0 +1,16 @@ +// 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 library referenced in an `import augment` directive is not an +/// augmentation and does not have a `library augment` directive. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `import augment` directive is not an does not have a `library augment` +/// directive +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library applying_augmentation_library_A01_t01.dart; diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t02.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t02.dart new file mode 100644 index 0000000000..b66ad52095 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t02.dart @@ -0,0 +1,26 @@ +// 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 library referenced in an `import augment` directive is not an +/// augmentation and does not have a `library augment` directive. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `import augment` directive is not an does not have a `library augment` +/// directive. Test the case when referenced library is part of the main library +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library applying_augmentation_library_A01_t02; + +import augment 'applying_augmentation_library_A01_t02_lib.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified + +part 'applying_augmentation_library_A01_t02_lib.dart'; + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t02_lib.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t02_lib.dart new file mode 100644 index 0000000000..84e75f5f1c --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t02_lib.dart @@ -0,0 +1,16 @@ +// 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 library referenced in an `import augment` directive is not an +/// augmentation and does not have a `library augment` directive. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `import augment` directive is not an does not have a `library augment` +/// directive. Test the case when referenced library is part of the main library +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +part of applying_augmentation_library_A01_t02; diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t03.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t03.dart new file mode 100644 index 0000000000..b8a05e5ec4 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t03.dart @@ -0,0 +1,23 @@ +// 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 library referenced in an `import augment` directive is not an +/// augmentation and does not have a `library augment` directive. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `import augment` directive is not an does not have a `library augment` +/// directive. Test the case when a main library also imports the referenced one +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +import 'applying_augmentation_library_A01_t03_lib.dart'; +import augment 'applying_augmentation_library_A01_t03_lib.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t03_lib.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t03_lib.dart new file mode 100644 index 0000000000..e83dcf5f55 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t03_lib.dart @@ -0,0 +1,16 @@ +// 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 library referenced in an `import augment` directive is not an +/// augmentation and does not have a `library augment` directive. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `import augment` directive is not an does not have a `library augment` +/// directive. Test the case when a main library also imports the referenced one +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library applying_augmentation_library_A01_t03; diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t01.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t01.dart new file mode 100644 index 0000000000..dec5978414 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t01.dart @@ -0,0 +1,20 @@ +// 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 library referenced in a `library augment` directive does not have an +/// `import augment` directive pointing back to this augmentation. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `library augment` directive is not an does not have a `import augment` +/// directive +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +import 'applying_augmentation_library_A02_t01_lib.dart'; + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t01_lib.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t01_lib.dart new file mode 100644 index 0000000000..6c71f91731 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t01_lib.dart @@ -0,0 +1,19 @@ +// 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 library referenced in a `library augment` directive does not have an +/// `import augment` directive pointing back to this augmentation. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `library augment` directive does not have a `import augment` directive +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library augment 'applying_augmentation_library_A02_t01.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02.dart new file mode 100644 index 0000000000..d70e7b7152 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02.dart @@ -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 It is a compile-time error if: +/// ... +/// - The library referenced in a `library augment` directive does not have an +/// `import augment` directive pointing back to this augmentation. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `library augment` directive is not an does not have a `import augment` +/// directive pointing back to this augmentation. +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +import 'applying_augmentation_library_A02_t02_lib1.dart'; +import augment 'applying_augmentation_library_A02_t02_lib2.dart'; + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02_lib1.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02_lib1.dart new file mode 100644 index 0000000000..ee2f764a7f --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02_lib1.dart @@ -0,0 +1,23 @@ +// 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 library referenced in a `library augment` directive does not have an +/// `import augment` directive pointing back to this augmentation. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `library augment` directive is not an does not have a `import augment` +/// directive pointing back to this augmentation. +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library augment 'applying_augmentation_library_A02_t02.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified + +// 'applying_augmentation_library_A02_t02.dart' is pointing back to +// 'applying_augmentation_library_A02_t02_lib2.dart' but not to this library diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02_lib2.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02_lib2.dart new file mode 100644 index 0000000000..c6e3164f17 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02_lib2.dart @@ -0,0 +1,19 @@ +// 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 library referenced in a `library augment` directive does not have an +/// `import augment` directive pointing back to this augmentation. +/// +/// @description Check that it is a compile-time error if a library referenced +/// in an `library augment` directive is not an does not have a `import augment` +/// directive pointing back to this augmentation. +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library augment 'applying_augmentation_library_A02_t02.dart'; + +// Another augmentation library of 'applying_augmentation_library_A02_t02.dart' diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t01.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t01.dart new file mode 100644 index 0000000000..549cc2d86b --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t01.dart @@ -0,0 +1,22 @@ +// 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 same augmentation library is applied more than once. +/// +/// @description Check that it is a compile-time error if the same augmentation +/// library is applied more than once. +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +import augment 'applying_augmentation_library_A03_t01_lib.dart'; +import augment 'applying_augmentation_library_A03_t01_lib.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t01_lib.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t01_lib.dart new file mode 100644 index 0000000000..c9ec816f2c --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t01_lib.dart @@ -0,0 +1,15 @@ +// 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 same augmentation library is applied more than once. +/// +/// @description Check that it is a compile-time error if the same augmentation +/// library is applied more than once. +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library augment 'applying_augmentation_library_A03_t01.dart'; diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t02.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t02.dart new file mode 100644 index 0000000000..74555be717 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t02.dart @@ -0,0 +1,17 @@ +// 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 there is more than one library +/// directive in a single file +/// +/// @description Check that it is a compile-time error if there is more than one +/// library directive in a single file +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +import augment 'applying_augmentation_library_A03_t02_lib.dart'; + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t02_lib.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t02_lib.dart new file mode 100644 index 0000000000..4ddfafe792 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t02_lib.dart @@ -0,0 +1,18 @@ +// 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 there is more than one library +/// directive in a single file +/// +/// @description Check that it is a compile-time error if there is more than one +/// library directive in a single file +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library augment 'applying_augmentation_library_A03_t02.dart'; +/**/library; +// ^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t01.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t01.dart new file mode 100644 index 0000000000..7ed66b4965 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t01.dart @@ -0,0 +1,23 @@ +// 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 main library and its augmentations do not all have the same language +/// version. There is only one user-visible library at the end, and it should +/// have a consistent version across its entire surface area. +/// +/// @description Check that it is a compile-time error if an augmentation +/// library has version lower than main. +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +import augment 'applying_augmentation_library_A04_t01_lib.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t01_lib.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t01_lib.dart new file mode 100644 index 0000000000..5a2d92968f --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t01_lib.dart @@ -0,0 +1,19 @@ +// 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 main library and its augmentations do not all have the same language +/// version. There is only one user-visible library at the end, and it should +/// have a consistent version across its entire surface area. +/// +/// @description Check that it is a compile-time error if an augmentation +/// library has version lower than main. +/// @author sgrekhov22@gmail.com + +// @dart=3.3 + +// SharedOptions=--enable-experiment=macros + +library augment 'applying_augmentation_library_A04_t01.dart'; diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t02.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t02.dart new file mode 100644 index 0000000000..3b3a82dc47 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t02.dart @@ -0,0 +1,25 @@ +// 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 main library and its augmentations do not all have the same language +/// version. There is only one user-visible library at the end, and it should +/// have a consistent version across its entire surface area. +/// +/// @description Check that it is a compile-time error if a main library has +/// version lower than augmentation. +/// @author sgrekhov22@gmail.com + +// @dart=3.3 + +// SharedOptions=--enable-experiment=macros + +import augment 'applying_augmentation_library_A04_t02_lib.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified + +main() { +} diff --git a/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t02_lib.dart b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t02_lib.dart new file mode 100644 index 0000000000..f1fa3b8bd3 --- /dev/null +++ b/LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t02_lib.dart @@ -0,0 +1,17 @@ +// 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 main library and its augmentations do not all have the same language +/// version. There is only one user-visible library at the end, and it should +/// have a consistent version across its entire surface area. +/// +/// @description Check that it is a compile-time error if an augmentation +/// library has version lower than main. +/// @author sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=macros + +library augment 'applying_augmentation_library_A04_t02.dart';