Commit 7efd2aa2 authored by Kenton Varda's avatar Kenton Varda

Merge branch 'master' of github.com:kentonv/capnproto

parents f740a60f 8a45a517
......@@ -522,6 +522,8 @@ void DynamicStruct::Builder::set(StructSchema::Field field, const DynamicValue::
if (value.getType() == DynamicValue::TEXT) {
// Convert from text.
rawValue = enumSchema.getEnumerantByName(value.as<Text>()).getOrdinal();
} else if (value.getType() == DynamicValue::INT || value.getType() == DynamicValue::UINT) {
rawValue = value.as<uint16_t>();
} else {
DynamicEnum enumValue = value.as<DynamicEnum>();
KJ_REQUIRE(enumValue.getSchema() == enumSchema, "Value type mismatch.") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment