I’m getting a static analysis error while implementing Dart’s Zone.
Code:
<code>void main() {
Zone.current.fork(specification: ZoneSpecification(scheduleMicrotask: (self, parent, zone, f) => parent.scheduleMicrotask(zone, f),
run: (self, parent, zone, f) => parent.run(zone, f)));
}
</code>
<code>void main() {
Zone.current.fork(specification: ZoneSpecification(scheduleMicrotask: (self, parent, zone, f) => parent.scheduleMicrotask(zone, f),
run: (self, parent, zone, f) => parent.run(zone, f)));
}
</code>
void main() {
Zone.current.fork(specification: ZoneSpecification(scheduleMicrotask: (self, parent, zone, f) => parent.scheduleMicrotask(zone, f),
run: (self, parent, zone, f) => parent.run(zone, f)));
}
error message:
The argument type ‘dynamic Function(dynamic, dynamic, dynamic, dynamic)’ can’t be assigned to the parameter type ‘R Function(Zone, ZoneDelegate, Zone, R Function())?
The error only appears while implementing non-void-return functions run, registeredCallback
and not with scheduleMicrotask, createTimer
(and remaining void functions)