Skip to content

Commit 2919dfd

Browse files
committed
Generate valid C# when a method from a secondary base has no native symbol
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 991c6ff commit 2919dfd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Generator/Generators/CSharp/CSharpSources.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ private void GatherClassInternalFunctions(Class @class, bool includeCtors,
629629

630630
foreach (var method in @class.Methods)
631631
{
632-
if (ASTUtils.CheckIgnoreMethod(method))
632+
if (!method.IsGenerated || ASTUtils.CheckIgnoreMethod(method))
633633
continue;
634634

635635
if (method.IsConstructor)
@@ -2755,6 +2755,13 @@ public void GenerateFunctionCall(string functionName, List<Parameter> parameters
27552755
return;
27562756
}
27572757

2758+
// ignored functions may get here from interfaces for secondary bases
2759+
if (function.Ignore)
2760+
{
2761+
WriteLine("throw new System.MissingMethodException(\"No C++ symbol to call.\");");
2762+
return;
2763+
}
2764+
27582765
var retType = function.OriginalReturnType;
27592766
if (returnType.Type == null)
27602767
returnType = retType;

0 commit comments

Comments
 (0)