-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Description
Assigning an Enum with its value fails when the enum is declared within a List:
Schema:
enum Status {
active @0;
inactive @1;
pending @2;
}
struct Container {
statuses @0 :List(Status);
}
When running this Python code (PyCapnp v2.0.0):
msg = Container()
msg.init("statuses", 1)
msg.statuses[0] = Status.activeThis exception gets raised:
KjException: capnp/dynamic.c++:1827: failed: expected reader.type == ENUM [4 == 9]; Value type mismatch.
However, assigning a string value works as expected:
msg.statuses[0] = "active"This behavior is odd, as assigning an Enum that is not declared within a List works perfectly:
Schema:
struct Container {
status @0 :Status;
}
Python code:
msg = Container()
msg.status = Status.activeMetadata
Metadata
Assignees
Labels
No labels