blob: 2e4f5a1fca0f2497dfa3449fac33149410dfa669 [file] [log] [blame]
import 'dart:collection';
String test1(Object o) => switch (o) {
[var x, 2, var y] => "match-1",
_ => "no match",
};
String test2(Object o) => switch (o) {
[1, var x, var y] => "match-1",
_ => "no match",
};
String test3(Object o) => switch (o) {
[var x!, 1] => "match-1",
[1, var x!] => "match-2",
_ => "no match",
};
class MyList<E> with ListMixin<E> {
E operator [](int index) {}
MyList(this.list);
String get log => sb.toString();
StringBuffer sb = new StringBuffer();
final List<E> list;
int get length => list.length;
void clearLog() {}
void operator []=(int index, E value) {}
void set length(int value) {}
}
expect(expected, actual) {}
main() {}