dproto icon indicating copy to clipboard operation
dproto copied to clipboard

`Error: no size because of forward reference` with self referenced messages

Open timotheecour opened this issue 6 years ago • 0 comments

enum def2=`
message Node {
  Node node1 = 1;
  Node node2 = 2;
}
`;

mixin ProtocolBufferFromString!(def2);

void test2(){
  Node node;
  node.node1=Node();
  node.node1.node2=Node();

  import std.stdio;
  writeln(node);
}

Error: struct tims.tests.d37_proto.test.ProtocolBufferFromString!"\x0amessage Node {\x0a Node node1 = 1;\x0a Node node2 = 2;\x0a}\x0a".Node no size because of forward reference

note: this is valid proto, see C++ example here: https://github.com/PMunch/protobuf-nim/issues/8#issue-310176558

D20180503T155619

timotheecour avatar Mar 30 '18 21:03 timotheecour