Closed
Description
See #37294
This code fails, now with a meaningful error message:
import 'dart:isolate';
void fun() {
print('hi from fun');
}
Future<void> main() async {
final x = <void Function()>[fun];
await Isolate.spawn(isolate, x);
}
void isolate(List<void Function()> foo) async {
print('Tick: $foo');
foo.first();
}
But this code works:
import 'dart:isolate';
void fun() {
print('hi from fun');
}
Future<void> main() async {
final x = <dynamic>[fun];
await Isolate.spawn(isolate, x);
}
void isolate(List<dynamic> foo) async {
print('Tick: $foo');
(foo.first as void Function())();
}
It'd be nice to let the typed version work too.