Skip to content

Commit

Permalink
dart-lang#2559. Fix augmenting operators syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Apr 23, 2024
1 parent 1999ed9 commit 0984483
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// function's return type.
///
/// @description Checks that inside an augmentation body of an operator
/// `augmented()` expression executes the body of the original operator.
/// `augmented` expression executes the body of the original operator.
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// function's return type.
///
/// @description Checks that inside an augmentation body of an operator
/// `augmented()` expression executes the body of the original operator.
/// `augmented` expression executes the body of the original operator.
/// @author sgrekhov22@gmail.com
// SharedOptions=--enable-experiment=macros
Expand All @@ -20,15 +20,15 @@ augment library 'augmenting_functions_A02_t12.dart';

augment class C {
augment String operator +(String other) {
_log += augmented(other);
_log += augmented + other;
_log += "augmented;";
return "C: augment other=$other";
}
}

augment mixin M {
augment String operator +(String other) {
_log += augmented(other);
_log += augmented + other;
_log += "augmented;";
return "M: augment other=$other";
}
Expand All @@ -38,15 +38,15 @@ augment enum E {
augment e1;

augment String operator +(String other) {
_log += augmented(other);
_log += augmented + other;
_log += "augmented;";
return "E: augment other=$other";
}
}

augment extension Ext {
augment String operator +(String other) {
_log += augmented(other);
_log += augmented + other;
_log += "augmented;";
return "Ext: augment other=$other";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// not at all.
///
/// @description Checks that it's not an error if an augmenting function passes
/// different arguments to the `augmented()` expression and calls it more than
/// different arguments to the `augmented` expression and calls it more than
/// once. Test operators.
/// @author sgrekhov22@gmail.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// function's return type.
///
/// @description Checks that it's not an error if an augmenting function passes
/// different arguments to the `augmented()` expression and calls it more than
/// different arguments to the `augmented` expression and calls it more than
/// once. Test operators.
/// @author sgrekhov22@gmail.com
Expand All @@ -21,18 +21,18 @@ augment library 'augmenting_functions_A03_t12.dart';

augment class C {
augment String operator +(String other) {
_log += augmented("a");
_log += augmented + "a";
_log += "augmented;";
augmented("b");
augmented + "b";
return "C: augment other=$other";
}
}

augment mixin M {
augment String operator +(String other) {
_log += augmented("c");
_log += augmented + "c";
_log += "augmented;";
augmented("d");
augmented + "d";
return "M: augment other=$other";
}
}
Expand All @@ -41,18 +41,18 @@ augment enum E {
augment e1;

augment String operator +(String other) {
_log += augmented("e");
_log += augmented + "e";
_log += "augmented;";
augmented("f");
augmented + "f";
return "E: augment other=$other";
}
}

augment extension Ext {
augment String operator +(String other) {
_log += augmented("g");
_log += augmented + "g";
_log += "augmented;";
augmented("h");
augmented + "h";
return "Ext: augment other=$other";
}
}

0 comments on commit 0984483

Please sign in to comment.