Skip to content

serializing user-defined types over sendport fails in dartc  #373

Closed
@DartBot

Description

@DartBot

This issue was originally filed by karl.k...@gmail.com


This code runs in dart_bin but throws exception during serialization with dartc:

class Pair {
  final k1;
  final k2;
  Pair(this.k1,this.k2);
  int hashCode() => 7 + 13k1.hashCode() + 17k2.hashCode();
  bool operator ==(obj) => (obj is Pair) && obj.k1 == k1 && obj.k2 == k2;
}

class A extends Isolate {
  main() {
    this.port.receive((m, sp) {
        print(m);
      });
  }
}

main() {

  ReceivePort rp = new ReceivePort();
  new A().spawn().then((SendPort sp) {
      sp.send(new Pair(1,2),rp.toSendPort());
  });

}

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