blob: 8f4f79304640a988f62fd5e153e20e5953cd8315 [file] [log] [blame]
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 as int;
});
Expect.equals(z, 4 * 42);
}