Skip to content

Send a closure to an isolate fails silently (dartC) #222

Closed
@DartBot

Description

@DartBot

This issue was originally filed by mikk...@gl26.dk


What steps will reproduce the problem?
Run this code in try.dartlang.org:

class MyIsolate extends Isolate {
  void main() {
    this.port.receive((message, replyTo) {
      print("Message with received: ${message}");
    });
  }
}

void main() {
  var iso = new MyIsolate();
  var f = (a) { print(a); };
  
  iso.spawn().then((port) {
     port.send(f);
  });
}
Link: http://try.dartlang.org/s/krkd

What is the expected output? What do you see instead?
I was expecting an error/exception or the message Message with received: Object printed in the output section.

When running nothing visible happens. Changing the line
   port.send(f);
to
   port.send("Hello");
results in the message: Message with received: Hello in the out put section
link: http://try.dartlang.org/s/WcEd

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

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-not-plannedClosed as we don't intend to take action on the reported issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions