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 @@ -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 @@ -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;

Loading…
Cancel
Save