diff --git a/capnpc-csharp.tests/Properties/Resources.Designer.cs b/capnpc-csharp.tests/Properties/Resources.Designer.cs
index ad396a7..65b57b9 100644
--- a/capnpc-csharp.tests/Properties/Resources.Designer.cs
+++ b/capnpc-csharp.tests/Properties/Resources.Designer.cs
@@ -90,6 +90,16 @@ namespace capnpc_csharp.Tests.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Byte[].
+ ///
+ internal static byte[] UnitTest20_capnp {
+ get {
+ object obj = ResourceManager.GetObject("UnitTest20_capnp", resourceCulture);
+ return ((byte[])(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Byte[].
///
diff --git a/capnpc-csharp.tests/Properties/Resources.resx b/capnpc-csharp.tests/Properties/Resources.resx
index 43736d8..5c256ea 100644
--- a/capnpc-csharp.tests/Properties/Resources.resx
+++ b/capnpc-csharp.tests/Properties/Resources.resx
@@ -121,6 +121,9 @@
..\Resources\UnitTest10.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ ..\Resources\UnitTest20.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
..\Resources\UnitTest3.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
diff --git a/capnpc-csharp.tests/Resources/UnitTest20.capnp.bin b/capnpc-csharp.tests/Resources/UnitTest20.capnp.bin
new file mode 100644
index 0000000..48f5e96
Binary files /dev/null and b/capnpc-csharp.tests/Resources/UnitTest20.capnp.bin differ
diff --git a/capnpc-csharp.tests/UnitTest20.capnp b/capnpc-csharp.tests/UnitTest20.capnp
new file mode 100644
index 0000000..edf91c9
--- /dev/null
+++ b/capnpc-csharp.tests/UnitTest20.capnp
@@ -0,0 +1,5 @@
+@0xcebb7a61a86a7492;
+
+annotation anAnnotation(file): Text;
+
+const aConstant :UInt16 = 42;
diff --git a/capnpc-csharp.tests/UnitTests.cs b/capnpc-csharp.tests/UnitTests.cs
index 26389b7..4c2966b 100644
--- a/capnpc-csharp.tests/UnitTests.cs
+++ b/capnpc-csharp.tests/UnitTests.cs
@@ -71,6 +71,15 @@ namespace CapnpC
Assert.AreEqual($"{innerNSStr}.Inner", innerNameSyntax.ToString());
}
+ [TestMethod]
+ public void Test20AnnotationAndConst()
+ {
+ var model = Load(Resources.UnitTest20_capnp);
+ var codeGen = NewGeneratorFor(model);
+ codeGen.Transform(model.FilesToGenerate.First());
+ // Should not throw
+ }
+
static Generator.CodeGenerator NewGeneratorFor(Model.SchemaModel model)
=> new Generator.CodeGenerator(model, new Generator.GeneratorOptions());