spawnFunction - doesn't accept static method #7698
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-duplicate
Closed in favor of an existing report
library-isolate
This issue was originally filed by [email protected]
What steps will reproduce the problem?
"The topLevelFunction argument must be a static top-level function or a static method that takes no arguments."
import "dart:isolate";
class Actor {
static _spawn() => new Actor().act();
static spawn() => spawnFunction(_spawn());
act() {
port.receive((message, replyTo){/* do something */});
}
}
main() {
var actor = Actor.spawn();
}
Unhandled exception:
Illegal argument(s): spawnFunction expects to be passed a closure to a top-level static function
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
The text was updated successfully, but these errors were encountered: