From ff4b6fb5db332efff58b5d02c01c6e8b32bab165 Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Tue, 2 Sep 2014 20:37:36 -0400 Subject: [PATCH] void constant --- compiler/src/main/cpp/capnpc-java.c++ | 2 +- compiler/src/test/scala/org/capnproto/EncodingTest.scala | 1 + compiler/src/test/schema/test.capnp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) 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;