Skip to content

Commit

Permalink
Fixes dart-lang#2756. Fix the new roll failures
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Jul 5, 2024
1 parent 67a43c4 commit 44367a7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ import augment 'augmented_expression_A05_t12_lib.dart';
var augmented = ["Top-level augmented", "should", "not", "be", "used"];

class C {
String operator [](int index) => "C[$ndex]";
String operator []=(int index, String value) => "C[$index]=$value";
String operator [](int index) => "C[$index]";
void operator []=(int index, String value) => "C[$index]=$value";
List<String> augmented = ["C.augmented", "should", "not", "be", "used"];
}

mixin M {
String operator [](int index) => "M[$ndex]";
String operator []=(int index, String value) => "M[$index]=$value";
String operator [](int index) => "M[$index]";
void operator []=(int index, String value) => "M[$index]=$value";
List<String> augmented = ["M.augmented", "should", "not", "be", "used"];
}

enum E {
e1;
String operator [](int index) => "E[$ndex]";
String operator []=(int index, String value) => "E[$index]=$value";
String operator [](int index) => "E[$index]";
void operator []=(int index, String value) => "E[$index]=$value";
List<String> augmented = ["E.augmented", "should", "not", "be", "used"];
}

class A {}

extension Ext on A {
String operator [](int index) => "Ext[$ndex]";
String operator []=(int index, String value) => "Ext[$index]=$value";
List<String> augmented = ["Ext.augmented", "should", "not", "be", "used"];
String operator [](int index) => "Ext[$index]";
void operator []=(int index, String value) => "Ext[$index]=$value";
List<String> get augmented => ["Ext.augmented", "should", "not", "be", "used"];
}

main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,34 @@ augment class C {
}

augment mixin M {
augment Record operator +(Object? other) {
augment String operator +(Object? other) {
String local() => "Augmented: ${augmented + other}";
return local();
}
augment Record operator [](int index) {
augment String operator [](int index) {
String local() => "Augmented: ${augmented[index]}";
return local();
}
}

augment enum E {
augment e1;
augment Record operator +(Object? other) {
augment String operator +(Object? other) {
String local() => "Augmented: ${augmented + other}";
return local();
}
augment Record operator [](int index) {
augment String operator [](int index) {
String local() => "Augmented: ${augmented[index]}";
return local();
}
}

augment extension Ext {
augment Record operator +(Object? other) {
augment String operator +(Object? other) {
String local() => "Augmented: ${augmented + other}";
return local();
}
augment Record operator [](int index) {
augment String operator [](int index) {
String local() => "Augmented: ${augmented[index]}";
return local();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ augment class C {
}

augment String operator [](int index) {
var f = () => "Augmented: ${augmented + other}";
var f = () => "Augmented: ${augmented[index]}";
return f();
}
}
Expand All @@ -39,7 +39,7 @@ augment mixin M {
return f();
}
augment String operator [](int index) {
var f = () => "Augmented: ${augmented + other}";
var f = () => "Augmented: ${augmented[index]}";
return f();
}
}
Expand All @@ -51,7 +51,7 @@ augment enum E {
return f();
}
augment String operator [](int index) {
var f = () => "Augmented: ${augmented + other}";
var f = () => "Augmented: ${augmented[index]}";
return f();
}
}
Expand All @@ -62,7 +62,7 @@ augment extension Ext {
return f();
}
augment String operator [](int index) {
var f = () => "Augmented: ${augmented + other}";
var f = () => "Augmented: ${augmented[index]}";
return f();
}
}

0 comments on commit 44367a7

Please sign in to comment.