Browse Source

Fix generation of C++ constructor for abstract classes.

pull/1318/head
João Matos 5 years ago committed by João Matos
parent
commit
aa2a7117ac
  1. 5
      src/Generator/Generators/C/CppSources.cs

5
src/Generator/Generators/C/CppSources.cs

@ -369,13 +369,16 @@ namespace CppSharp.Generators.Cpp
if (@class.IsRefType) if (@class.IsRefType)
{ {
if (method.IsConstructor && !@class.IsAbstract) if (method.IsConstructor)
{
if (!@class.IsAbstract)
{ {
var @params = GenerateFunctionParamsMarshal(method.Parameters, method); var @params = GenerateFunctionParamsMarshal(method.Parameters, method);
Write($"{Helpers.InstanceIdentifier} = new ::{method.Namespace.QualifiedOriginalName}("); Write($"{Helpers.InstanceIdentifier} = new ::{method.Namespace.QualifiedOriginalName}(");
GenerateFunctionParams(@params); GenerateFunctionParams(@params);
WriteLine(");"); WriteLine(");");
} }
}
else else
{ {
GenerateFunctionCall(method); GenerateFunctionCall(method);

Loading…
Cancel
Save