-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Illegal argument in isolate message : (function types are not supported yet) #44624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We do not support sending of ReceivePort across isolates. In the example above when the isolate is spawned the 'worker' object is sent across. This object is of type IsolateWorker which has a ReceivePort field 'supervisingReceivePort'. |
@a-siva I dont send ReceivePort when spawn the |
The reason is that the any field of object in message of entrypoint can not contain a Function type, as show in error. feature support function type will be add new SDK version? |
@wustrong I suspect that either It is very easy to reproduce such cases: import 'dart:isolate';
Type getType<T>() => T;
main() async => await Isolate.spawn(entrypoint, getType<void Function()>());
void entrypoint(dynamic x) {} which results in
or import 'dart:isolate';
Function getClosure() => () {};
main() async => await Isolate.spawn(entrypoint, getClosure());
void entrypoint(dynamic x) {} which results in
Both of these issues we intend to fix with lightweight isolates (see #36097) which is nearing it's completion - so stay tuned :-) |
Closing this issue, merge into the more general #46623. |
This tracker is for issues related to:
Dart VM
Dart SDK Version (
dart --version
)Dart SDK version: 2.10.3 (stable) (Tue Oct 27 14:44:30 2020 +0100) on "linux_x64"
I tried to spawn a new isolate,but failed. I do not know why and how to figure it out . the error response like this:
here is my code:
top-level or static method
spawn
entrypoint message
The text was updated successfully, but these errors were encountered: