diff --git a/capnpc-csharp.tests/Properties/Resources.Designer.cs b/capnpc-csharp.tests/Properties/Resources.Designer.cs index a67166c..6840817 100644 --- a/capnpc-csharp.tests/Properties/Resources.Designer.cs +++ b/capnpc-csharp.tests/Properties/Resources.Designer.cs @@ -69,5 +69,15 @@ namespace capnpc_csharp.Tests.Properties { return ((byte[])(obj)); } } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] UnitTest2_capnp { + get { + object obj = ResourceManager.GetObject("UnitTest2_capnp", resourceCulture); + return ((byte[])(obj)); + } + } } } diff --git a/capnpc-csharp.tests/Properties/Resources.resx b/capnpc-csharp.tests/Properties/Resources.resx index bc2d6ee..a67f487 100644 --- a/capnpc-csharp.tests/Properties/Resources.resx +++ b/capnpc-csharp.tests/Properties/Resources.resx @@ -118,6 +118,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\UnitTest2.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\UnitTest1.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/capnpc-csharp.tests/Resources/UnitTest2.capnp.bin b/capnpc-csharp.tests/Resources/UnitTest2.capnp.bin new file mode 100644 index 0000000..5a2eafc Binary files /dev/null and b/capnpc-csharp.tests/Resources/UnitTest2.capnp.bin differ diff --git a/capnpc-csharp.tests/UnitTest2.capnp b/capnpc-csharp.tests/UnitTest2.capnp new file mode 100644 index 0000000..e4cbcb9 --- /dev/null +++ b/capnpc-csharp.tests/UnitTest2.capnp @@ -0,0 +1,11 @@ +@0xf6041efc5e8b1e59; + +interface Interface1(V1) {} + +interface Interface { + method @0 () -> (arg : AnyPointer); + method1 @1 () -> (arg : Interface1(AnyPointer)); + method2 @2 () -> (arg : Interface2(AnyPointer)); +} + +interface Interface2(V2) {} diff --git a/capnpc-csharp.tests/UnitTests.cs b/capnpc-csharp.tests/UnitTests.cs index 2d4ea6b..dd37864 100644 --- a/capnpc-csharp.tests/UnitTests.cs +++ b/capnpc-csharp.tests/UnitTests.cs @@ -31,6 +31,15 @@ namespace CapnpC Assert.AreNotEqual(structFoo.Name, fieldName); } + [TestMethod] + public void Test02ForwardInheritance() + { + var model = Load(Resources.UnitTest2_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());