Skip to content

Commit

Permalink
dart-lang#2559. Add augmenting types tests. Part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Mar 13, 2024
1 parent 5c18c22 commit a93c34b
Show file tree
Hide file tree
Showing 30 changed files with 1,680 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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 augmenting type and corresponding type do not have all the same
/// modifiers (final, sealed, mixin, etc).
///
/// @description Checks that it is a compile-time error if an augmenting type
/// and corresponding type do not have all the same modifiers (final, sealed,
/// mixin, etc). Test `class` in the main library
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros

import augment 'augmenting_types_A02_t01_lib.dart';

class C {}

main() {
print(C);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// 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 do not have all the same
/// modifiers (final, sealed, mixin, etc).
///
/// @description Checks that it is a compile-time error if an augmenting type
/// and corresponding type do not have all the same modifiers (final, sealed,
/// mixin, etc). Test `class` in the main library
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros

library augment 'augmenting_types_A02_t01.dart';

augment class C {} // Ok

augment base class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment interface class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment final class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment sealed class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract base class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract interface class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract final class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment base mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract base mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment mixin C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment base mixin C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
Original file line number Diff line number Diff line change
@@ -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 augmenting type and corresponding type do not have all the same
/// modifiers (final, sealed, mixin, etc).
///
/// @description Checks that it is a compile-time error if an augmenting type
/// and corresponding type do not have all the same modifiers (final, sealed,
/// mixin, etc). Test `base class` in the main library
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros

import augment 'augmenting_types_A02_t02_lib.dart';

base class C {}

main() {
print(C);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// 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 do not have all the same
/// modifiers (final, sealed, mixin, etc).
///
/// @description Checks that it is a compile-time error if an augmenting type
/// and corresponding type do not have all the same modifiers (final, sealed,
/// mixin, etc). Test `base class` in the main library
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros

library augment 'augmenting_types_A02_t02.dart';

augment class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment base class C {} // Ok

augment interface class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment final class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment sealed class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract base class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract interface class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract final class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment base mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract base mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment mixin C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment base mixin C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
Original file line number Diff line number Diff line change
@@ -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 augmenting type and corresponding type do not have all the same
/// modifiers (final, sealed, mixin, etc).
///
/// @description Checks that it is a compile-time error if an augmenting type
/// and corresponding type do not have all the same modifiers (final, sealed,
/// mixin, etc). Test `interface class` in the main library
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros

import augment 'augmenting_types_A02_t03_lib.dart';

interface class C {}

main() {
print(C);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// 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 do not have all the same
/// modifiers (final, sealed, mixin, etc).
///
/// @description Checks that it is a compile-time error if an augmenting type
/// and corresponding type do not have all the same modifiers (final, sealed,
/// mixin, etc). Test `interface class` in the main library
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros

library augment 'augmenting_types_A02_t03.dart';

augment class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment base class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment interface class C {} // Ok

augment final class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment sealed class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract base class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract interface class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract final class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment base mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment abstract base mixin class C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment mixin C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment base mixin C {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
Original file line number Diff line number Diff line change
@@ -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 augmenting type and corresponding type do not have all the same
/// modifiers (final, sealed, mixin, etc).
///
/// @description Checks that it is a compile-time error if an augmenting type
/// and corresponding type do not have all the same modifiers (final, sealed,
/// mixin, etc). Test `final class` in the main library
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros

import augment 'augmenting_types_A02_t04_lib.dart';

final class C {}

main() {
print(C);
}

0 comments on commit a93c34b

Please sign in to comment.