void constant

This commit is contained in:
David Renshaw 2014-09-02 20:37:36 -04:00
parent b59120f6f5
commit ff4b6fb5db
3 changed files with 3 additions and 2 deletions

View file

@ -313,7 +313,7 @@ private:
kj::StringTree literalValue(schema::Type::Reader type, schema::Value::Reader value) {
switch (value.which()) {
case schema::Value::VOID: return kj::strTree(" ::capnp::VOID");
case schema::Value::VOID: return kj::strTree("org.capnproto.Void.VOID");
case schema::Value::BOOL: return kj::strTree(value.getBool() ? "true" : "false");
case schema::Value::INT8: return kj::strTree(value.getInt8());
case schema::Value::INT16: return kj::strTree(value.getInt16());

View file

@ -33,6 +33,7 @@ class EncodingSuite extends FunSuite {
}
test("Constants") {
assert(Void.VOID == TestConstants.VOID_CONST);
assert(true == TestConstants.BOOL_CONST);
assert(-123 == TestConstants.INT8_CONST);
assert(-12345 == TestConstants.INT16_CONST);

View file

@ -164,7 +164,7 @@ struct TestGroups {
}
struct TestConstants {
# const voidConst :Void = void;
const voidConst :Void = void;
const boolConst :Bool = true;
const int8Const :Int8 = -123;
const int16Const :Int16 = -12345;