blob: 711dfb0bcd1db1e5883f80ad7c7571364afabdc9 [file] [edit]
// 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's a compile-time error if an augmentation doesn't have the
/// same kind as the introductory declaration. For example, augmenting a `class`
/// with a `mixin`, an `enum` with a function, a method with a getter, etc.
///
/// @description Checks that it is a compile-time error if an augmenting
/// declaration is a type alias and an augmented one is not
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=augmentations
class C {}
mixin M {}
enum E {e1;}
extension type ET(int _) {}
class A {}
augment typedef C = A;
// ^
// [analyzer] unspecified
// [cfe] unspecified
augment typedef M = A;
// ^
// [analyzer] unspecified
// [cfe] unspecified
augment typedef E = A;
// ^
// [analyzer] unspecified
// [cfe] unspecified
augment typedef ET = A;
// ^^
// [analyzer] unspecified
// [cfe] unspecified
main() {
print(C);
print(M);
print(E);
print(ET);
}