diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 2466f7d..bb6b019 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -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()); diff --git a/compiler/src/test/scala/org/capnproto/EncodingTest.scala b/compiler/src/test/scala/org/capnproto/EncodingTest.scala index 1e6068b..918ffb5 100644 --- a/compiler/src/test/scala/org/capnproto/EncodingTest.scala +++ b/compiler/src/test/scala/org/capnproto/EncodingTest.scala @@ -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); diff --git a/compiler/src/test/schema/test.capnp b/compiler/src/test/schema/test.capnp index 718ab6b..7727455 100644 --- a/compiler/src/test/schema/test.capnp +++ b/compiler/src/test/schema/test.capnp @@ -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;