dev_compiler
dev_compiler copied to clipboard
extension method (or all List?) tear offs are broken
e.g. this call site:
let list = [];
dart.dsend(f(), 'forEach', dart.bind(list, dartx.add));
Here list is just a normal array. It assets in dart.bind because it couldn't find the type info using the symbol as lookup key. Not sure if it would've worked with 'add' ... if I try:
_methodSig // verify this is in scope: Symbol(sig)
obj.__proto__.constructor[_methodSig]
where obj is list, it still doesn't find anything, so maybe we just have no signatures for JsArray methods?
btw, the code came from here in async_star_test.dart:
test("call delays", () {
var list = [];
f() async* { list.add(1); yield 2; }
var res = f().forEach(list.add);
list.add(0);
return res.whenComplete(() {
expect(list, equals([0, 1, 2]));
});
});