Is this a feature or a bug?

struct Outer {
    inner @0 :Inner;
}

struct Inner(T) {
    value @0 :T;
}

struct ValueA { a @0 :Int32; }
struct ValueB { b @0 :Int32; }

const outerWorks :Outer = (inner = .innerWorks);
const innerWorks :Inner = ();

const outer :Outer = (inner = .inner); # fails here
const inner :Inner(Value) = (value = ());

Fails with error: Type mismatch; expected Inner.

I'd like at minimum the above to work, but ideally I would really like is 
something like:

struct OuterList {
  inners @0 :List(Inner);
}

const outer :OuterList = [
  (inner = :Inner(ValueA) (a = 0)),
  (inner = :Inner(ValueB) (b = 42)),
];

Any thoughts? I could take a stab at implementing whatever you suggest. - 
Kuba

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/ab0c1e68-f52e-46aa-b4e5-c51a113358c1%40googlegroups.com.

Reply via email to