From 2919dfddbddc91ab1ff90e8a40f7d28ab3fa420b Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Tue, 25 Jun 2019 15:25:59 +0300 Subject: [PATCH] Generate valid C# when a method from a secondary base has no native symbol Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpSources.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index ee7531e3..f4246f89 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -629,7 +629,7 @@ namespace CppSharp.Generators.CSharp foreach (var method in @class.Methods) { - if (ASTUtils.CheckIgnoreMethod(method)) + if (!method.IsGenerated || ASTUtils.CheckIgnoreMethod(method)) continue; if (method.IsConstructor) @@ -2755,6 +2755,13 @@ namespace CppSharp.Generators.CSharp return; } + // ignored functions may get here from interfaces for secondary bases + if (function.Ignore) + { + WriteLine("throw new System.MissingMethodException(\"No C++ symbol to call.\");"); + return; + } + var retType = function.OriginalReturnType; if (returnType.Type == null) returnType = retType;