Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,65 @@
// BSD-style license that can be found in the LICENSE file.

/// @assertion It is a compile-time error if:
/// - The signature of the constructor augmentation does not match the original
/// constructor. It must have the same number of positional parameters, the
/// same named parameters, and matching parameters must have the same type,
/// optionality, and any required modifiers must match. Any initializing
/// formals and super parameters must also be the same in both constructors.
/// - The signature of the augmenting function does not match the signature of
/// the augmented function.
///
/// @description Checks that it is a compile-time error if the signature of the
/// constructor augmentation does not match the original constructor. Test wrong
/// number of positional parameters.
/// @author sgrekhov22@gmail.com

// SharedOptions=--enable-experiment=macros

part 'augmenting_constructors_A01_t01_lib.dart';
// SharedOptions=--enable-experiment=augmentations

class C {
C(int x);
}

augment class C {
augment C();
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment C(int x, int y);
// ^
// [analyzer] unspecified
// [cfe] unspecified
}

enum E {
e0(0);
const E(int x);
}

augment enum E {
;
augment const E();
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment const E(int x, int y);
// ^
// [analyzer] unspecified
// [cfe] unspecified
}

extension type ET(int id) {
ET.foo(this.id);
}

augment extension type ET {
augment ET.foo();
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
augment ET.foo(int id, int y);
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
print(C);
print(E);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,102 @@
// BSD-style license that can be found in the LICENSE file.

/// @assertion It is a compile-time error if:
/// - The signature of the constructor augmentation does not match the original
/// constructor. It must have the same number of positional parameters, the
/// same named parameters, and matching parameters must have the same type,
/// optionality, and any required modifiers must match. Any initializing
/// formals and super parameters must also be the same in both constructors.
/// - The signature of the augmenting function does not match the signature of
/// the augmented function.
///
/// @description Checks that it is a compile-time error if the signature of the
/// constructor augmentation does not match the original constructor. Test wrong
/// number of optional parameters.
/// number of optional positional parameters.
/// @author sgrekhov22@gmail.com

// SharedOptions=--enable-experiment=macros

part 'augmenting_constructors_A01_t02_lib.dart';
// SharedOptions=--enable-experiment=augmentations

class C {
C([int x = 0]);
C.n({int x = 0});
}

augment class C {
augment C();
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment C([int x, int y]);
// ^
// [analyzer] unspecified
// [cfe] unspecified
}

augment class C {
augment C.n();
// ^^^
// [analyzer] unspecified
// [cfe] unspecified

augment C.n({int x, int y});
// ^^^
// [analyzer] unspecified
// [cfe] unspecified
}

enum E {
e0(0);
const E([int x = 0]);
const E.n({int x = 0});
}

augment enum E {
;
augment const E();
// ^
// [analyzer] unspecified
// [cfe] unspecified

augment const E([int x, int y]);
// ^
// [analyzer] unspecified
// [cfe] unspecified
}

augment enum E {
augment e0;
augment const E.n();
// ^^^
// [analyzer] unspecified
// [cfe] unspecified

augment const E.n({int x, int y});
// ^^^
// [analyzer] unspecified
// [cfe] unspecified
}

extension type ET(int id) {
ET.foo([int x = 0]): this.id = 0;
ET.baz({int x = 0}): this.id = 0;
}

augment extension type ET {
augment ET.foo();
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
augment ET.foo([int x, int y = 0]);
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

augment ET.baz();
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
augment ET.baz({int x, int y = 0});
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
print(C);
print(E);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,51 @@
// BSD-style license that can be found in the LICENSE file.

/// @assertion It is a compile-time error if:
/// - The signature of the constructor augmentation does not match the original
/// constructor. It must have the same number of positional parameters, the
/// same named parameters, and matching parameters must have the same type,
/// optionality, and any required modifiers must match. Any initializing
/// formals and super parameters must also be the same in both constructors.
/// - The signature of the augmenting function does not match the signature of
/// the augmented function.
///
/// @description Checks that it is a compile-time error if the signature of the
/// constructor augmentation does not match the original constructor. Test wrong
/// names of named parameters.
/// @author sgrekhov22@gmail.com

// SharedOptions=--enable-experiment=macros

part 'augmenting_constructors_A01_t03_lib.dart';
// SharedOptions=--enable-experiment=augmentations

class C {
C({int x = 0});
}

augment class C {
augment C({int y});
// ^
// [analyzer] unspecified
// [cfe] unspecified
}

enum E {
e0;
//^^
const E({int x = 0});
}

augment enum E {
;
augment const E({int y});
// ^
// [analyzer] unspecified
// [cfe] unspecified
const E({int x = 0});
}

extension type ET(int id) {
ET.baz({int x = 0}): this.id = 0;
}

augment extension type ET {
augment ET.baz({int y});
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
print(C);
print(E);
Expand Down
Loading
Loading