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
Documentation of Isolate.spawn is incomplete #15234
Comments
The VM should detect this earlier, and throw an ArgumentError. |
This comment was originally written by alexe.kaigorodov@gmail.com see co19 test LibTest/isolate/Isolate/spawn_A02_t01 from https://code.google.com/p/co19/source/detail?r=669 . Remove "return" statement from the middle of the text to enable the test. |
This comment was originally written by alexe.kaigorodov@gmail.com An Error is thrown, but not at the place of invokation: main() { var receivePort = new ReceivePort(); try { gives: no exception Unhandled exception: Validation should be performed as soon as possible, in the Isolate.spawn() function. |
The VM now does throw an argument error, at the line of
|
This issue was originally filed by alexe.kaigorodov@gmail.com
The description of the static method Isolate.spawn reads:
It must be a top-level function or a static method that takes one argument - that is, one-parameter functions that can be compile-time constant function values. It is not allowed to pass the value of function expressions or an instance method extracted from an object.
It is not said what happens if the argument is not a compile-time constant function. Now an error message like "in ShutdownIsolate: Unable to resolve function 'f' in library" is printed, and the program hangs. Evidently, hanging is not a best behaviour, but I cannot file a bug against dart vm because formally it is allowed.
The text was updated successfully, but these errors were encountered: