Skip to content

Commit

Permalink
dart-lang#2559. Add factory constructors to augmented_expression_A04_…
Browse files Browse the repository at this point in the history
…t*.dart tests (dart-lang#3011)

Add factory constructors to augmented_expression_A04_t*.dart tests
  • Loading branch information
sgrekhov authored Dec 11, 2024
1 parent 01e0678 commit 575fd9a
Show file tree
Hide file tree
Showing 68 changed files with 732 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const augmented = "Augmented constant, should not be used";
void topLevelFunction() {}

class C {
C();
factory C.f() => C();
static void staticMethod() {}
void instanceMethod() {}
final augmented = "C.augmented, should not be used";
Expand Down Expand Up @@ -52,6 +54,7 @@ extension Ext on A {
}

extension type ET(int _) {
factory ET.f() => ET(0);
static void staticMethod() {}
void instanceMethod() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ augment class C {
// [analyzer] unspecified
// [cfe] unspecified
}
augment factory C.f() {
var f = augmented;
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return C();
}
}

augment mixin M {
Expand Down Expand Up @@ -101,4 +108,11 @@ augment extension type ET {
// [analyzer] unspecified
// [cfe] unspecified
}
augment factory ET.f() {
var f = augmented;
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return ET(0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ augment class C {
// [cfe] unspecified
};
}
augment factory C.f() {
var f = augmented.toString();
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return C();
}
}

augment mixin M {
Expand Down Expand Up @@ -123,4 +130,11 @@ augment extension type ET {
// [cfe] unspecified
};
}
augment factory ET.f() {
var f = augmented.toString();
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return ET(0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ part 'augmented_expression_A04_t02_lib.dart';
void topLevelFunction() {}

class C {
C();
factory C.f() => C();
static void staticMethod() {}
void instanceMethod() {}
}
Expand All @@ -46,6 +48,7 @@ extension Ext on A {
}

extension type ET(int _) {
factory ET.f() => ET(0);
static void staticMethod() {}
void instanceMethod() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ augment void topLevelFunction() {
}

augment class C {
augment factory C.f() {
var augmented;
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return C();
}
augment static void staticMethod() {
var augmented;
// ^^^^^^^^^
Expand Down Expand Up @@ -89,6 +96,13 @@ augment extension Ext {
}

augment extension type ET {
augment factory ET.f() {
var augmented;
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return ET(0);
}
augment static void staticMethod() {
var augmented;
// ^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ part 'augmented_expression_A04_t03_lib.dart';
void topLevelFunction() {}

class C {
C();
factory C.f() => C();
static void staticMethod() {}
void instanceMethod() {}
}
Expand All @@ -46,6 +48,7 @@ extension Ext on A {
}

extension type ET(int _) {
factory ET.f() => ET(0);
static void staticMethod() {}
void instanceMethod() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ augment void topLevelFunction() {
}

augment class C {
augment factory C.f() {
int augmented() => 42;
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return C();
}
augment static void staticMethod() {
int augmented() => 42;
// ^^^^^^^^^
Expand Down Expand Up @@ -89,6 +96,13 @@ augment extension Ext {
}

augment extension type ET {
augment factory ET.f() {
int augmented() => 42;
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return ET(0);
}
augment static void staticMethod() {
int augmented() => 42;
// ^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ part 'augmented_expression_A04_t04_lib.dart';
void topLevelFunction() {}

class C {
C();
factory C.f() => C();
static void staticMethod() {}
void instanceMethod() {}
}
Expand All @@ -47,6 +49,7 @@ extension Ext on A {
}

extension type ET(int _) {
factory ET.f() => ET(0);
static void staticMethod() {}
void instanceMethod() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ augment void topLevelFunction() {
}

augment class C {
augment factory C.f() {
switch((1,)) {
case (var augmented,):
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
return C();
}
augment static void staticMethod() {
switch((1,)) {
case (var augmented,):
Expand Down Expand Up @@ -108,6 +117,15 @@ augment extension Ext {
}

augment extension type ET {
augment factory ET.f() {
switch((1,)) {
case (var augmented,):
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
return ET(0);
}
augment static void staticMethod() {
switch((1,)) {
case (var augmented,):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ part 'augmented_expression_A04_t05_lib.dart';
void topLevelFunction() {}

class C {
C();
factory C.f() => C();
static void staticMethod() {}
void instanceMethod() {}
}
Expand All @@ -47,6 +49,7 @@ extension Ext on A {
}

extension type ET(int _) {
factory ET.f() => ET(0);
static void staticMethod() {}
void instanceMethod() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ augment void topLevelFunction() {
}

augment class C {
augment factory C.f() {
var (augmented) = (42);
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return C();
}
augment static void staticMethod() {
var (augmented) = (42);
// ^^^^^^^^^
Expand Down Expand Up @@ -90,6 +97,13 @@ augment extension Ext {
}

augment extension type ET {
augment factory ET.f() {
var (augmented) = 42;
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return ET(0);
}
augment static void staticMethod() {
var (augmented) = 42;
// ^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ part 'augmented_expression_A04_t06_lib.dart';
void topLevelFunction() {}

class C {
C();
factory C.f() => C();
static void staticMethod() {}
void instanceMethod() {}
}
Expand All @@ -47,6 +49,7 @@ extension Ext on A {
}

extension type ET(int _) {
factory ET.f() => ET(0);
static void staticMethod() {}
void instanceMethod() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ augment void topLevelFunction() {
}

augment class C {
augment factory C.f() {
var [augmented] = [42];
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return C();
}
augment static void staticMethod() {
var [augmented] = [42];
// ^^^^^^^^^
Expand Down Expand Up @@ -90,6 +97,13 @@ augment extension Ext {
}

augment extension type ET {
augment factory ET.f() {
var [augmented] = [42];
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return ET(0);
}
augment static void staticMethod() {
var [augmented] = [42];
// ^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ part 'augmented_expression_A04_t07_lib.dart';
void topLevelFunction() {}

class C {
C();
factory C.f() => C();
static void staticMethod() {}
void instanceMethod() {}
}
Expand All @@ -47,6 +49,7 @@ extension Ext on A {
}

extension type ET(int _) {
factory ET.f() => ET(0);
static void staticMethod() {}
void instanceMethod() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ augment void topLevelFunction() {
}

augment class C {
augment factory C.f() {
var {"key": augmented} = {"key": 42};
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return C();
}
augment static void staticMethod() {
var {"key": augmented} = {"key": 42};
// ^^^^^^^^^
Expand Down Expand Up @@ -90,6 +97,13 @@ augment extension Ext {
}

augment extension type ET {
augment factory ET.f() {
var {"key": augmented} = {"key": 42};
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return ET(0);
}
augment static void staticMethod() {
var {"key": augmented} = {"key": 42};
// ^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ part 'augmented_expression_A04_t08_lib.dart';
void topLevelFunction() {}

class C {
C();
factory C.f() => C();
static void staticMethod() {}
void instanceMethod() {}
}
Expand All @@ -47,6 +49,7 @@ extension Ext on A {
}

extension type ET(int _) {
factory ET.f() => ET(0);
static void staticMethod() {}
void instanceMethod() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ augment void topLevelFunction() {
}

augment class C {
augment factory C.f() {
var (augmented,) = (42,);
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return C();
}
augment static void staticMethod() {
var (augmented,) = (42,);
// ^^^^^^^^^
Expand Down Expand Up @@ -90,6 +97,13 @@ augment extension Ext {
}

augment extension type ET {
augment factory ET.f() {
var (augmented,) = (42,);
// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
return ET(0);
}
augment static void staticMethod() {
var (augmented,) = (42,);
// ^^^^^^^^^
Expand Down
Loading

0 comments on commit 575fd9a

Please sign in to comment.