Skip to content

Instantly share code, notes, and snippets.

@mokele
Last active January 27, 2016 12:06
Show Gist options
  • Save mokele/44682d3dcbb11ce80f4e to your computer and use it in GitHub Desktop.
Save mokele/44682d3dcbb11ce80f4e to your computer and use it in GitHub Desktop.
% struct FooBar {
% union {
% foo @0 :Foo
% bar @1 :Bar
% }
% }
% struct Foo {
% foo @0 :Text
% }
% struct Bar {
% bar @0 :Text
% }
{ok, R} = ecapnp:set_root(foobar_capnp:'FooBar'()),
Foo = ecapnp:set(foo, R),
ok = ecapnp:set(foo, <<"Foo">>, Foo).
%** exception error: no function clause matching ecapnp_ref:ptr(0,{ref,0,2,0,0,null,{builder,<0.341.0>}}) (src/ecapnp_ref.erl, line 120)
% in function ecapnp_set:set_field/3 (src/ecapnp_set.erl, line 127)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment