capnproto icon indicating copy to clipboard operation
capnproto copied to clipboard

Windows binary produces confusing error when attempting to use generic parameter in List

Open as-com opened this issue 1 year ago • 1 comments

test.capnp:

@0x91dfecf2a2e33a77;

struct Foo(T) {
    data @0 :List(T);
}

struct Bar {
    a @0 :UInt32;
}

struct Baz {
    a @0 :Foo(Bar);
}

Using the Windows binary downloaded from https://capnproto.org/capnproto-c++-win32-1.0.2.zip:

> capnp --version
Cap'n Proto version 1.0.2
> capnp compile -ocapnp test.capnp
*** Uncaught exception ***
capnp/compiler/node-translator.c++:1374: context: member.name = data
capnp/schema.capnp.h:6800: failed: expected (which() == Type::AnyPointer::UNCONSTRAINED); Must check which() before get()ing a union member.

Using a Linux binary:

> capnp --version
Cap'n Proto version 1.0.2
> capnp compile -ocapnp test.capnp
test.capnp:4:14-21: error: 'List(AnyPointer)' is not supported.

as-com avatar May 06 '24 04:05 as-com

This sounds like the same issue being addressed in #1807 (which I've been way too slow to review, sorry).

kentonv avatar May 06 '24 14:05 kentonv