Browse Source

Generate valid C# when a method from a secondary base has no native symbol

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1159/merge
Dimitar Dobrev 6 years ago
parent
commit
2919dfddbd
  1. 9
      src/Generator/Generators/CSharp/CSharpSources.cs

9
src/Generator/Generators/CSharp/CSharpSources.cs

@ -629,7 +629,7 @@ namespace CppSharp.Generators.CSharp
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (ASTUtils.CheckIgnoreMethod(method)) if (!method.IsGenerated || ASTUtils.CheckIgnoreMethod(method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -2755,6 +2755,13 @@ namespace CppSharp.Generators.CSharp
return; 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; var retType = function.OriginalReturnType;
if (returnType.Type == null) if (returnType.Type == null)
returnType = retType; returnType = retType;

Loading…
Cancel
Save