Skip to content
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

spawnFunction - doesn't accept static method #7698

Closed
DartBot opened this issue Jan 4, 2013 · 5 comments
Closed

spawnFunction - doesn't accept static method #7698

DartBot opened this issue Jan 4, 2013 · 5 comments
Assignees
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

Comments

@DartBot
Copy link

DartBot commented Jan 4, 2013

This issue was originally filed by [email protected]


What steps will reproduce the problem?

  1. dart:isolate doc says:
    "The topLevelFunction argument must be a static top-level function or a static method that takes no arguments."
  2. Run
    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();
}

  1. Dart throws exception
    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?

  • spawnFunction() should accept static methods too.

What version of the product are you using? On what operating system?

  • Linux karl-VirtualBox 3.2.0-35-generic-pae #­55-Ubuntu SMP Wed Dec 5 18:04:39 UTC 2012 i686 i686 i386 GNU/Linux
  • Dart VM version: 0.2.9.9_r16323_karl (Sun Dec 30 13:38:16 2012)

Please provide any additional information below.

@dgrove
Copy link
Contributor

dgrove commented Jan 4, 2013

Set owner to @justinfagnani.
Added Area-Library, Library-Isolates, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jan 4, 2013

This comment was originally written by [email protected]


Actually, the sample code should be:

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();
}

@dgrove
Copy link
Contributor

dgrove commented Jan 11, 2013

Added Library-Isolate label.

@dgrove
Copy link
Contributor

dgrove commented Jan 11, 2013

Removed Library-Isolates label.

@lrhn
Copy link
Member

lrhn commented Nov 12, 2013

Added Duplicate label.
Marked as being merged into #3011.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-isolate closed-duplicate Closed in favor of an existing report labels Nov 12, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants