blob: 3ae1cadddede95e7faae7ae4b82e92180f2fa876 [file] [log] [blame]
import 'dart:collection';
class NegativeLengthList<E> with ListMixin<E> {
E operator [](int index) => _list[index];
NegativeLengthList(this._list);
final List<E> _list;
int get length => _list.length <= 0 ? -1 : _list.length;
void operator []=(int index, E value) {}
void set length(int value) {}
}
expect(expected, actual) {}
int switchList(List<int> list) => switch (list) {
[_, _, ...] => 2,
[_] => 1,
[] => 0,
};
main() {}