blob: 233cb3a820b6896e4d9d960aa5e438ddb7ac160a [file] [log] [blame]
// @dart = 2.9
import 'dart:collection';
import 'package:expect/expect.dart';
class MyList extends ListBase {
int get length => 4;
set length(int x) {}
int operator [](int x) => 42;
void operator []=(int x, val) {}
}
main() {
var x = new MyList();
int z = 0;
x.forEach((y) {
z += y;
});
Expect.equals(z, 4 * 42);
}