Skip to content

Overriding of pure virtual method is incorrect in C# wrapper #1283

Open
@ArtsevDmitry

Description

@ArtsevDmitry

I'm playing around OpenCascade simple wrapper. I use one header "Geom2d_Line.hxx", class Geom2d_Line inherited from Geom2d_Curve which contain next method:

  Standard_EXPORT virtual Standard_Boolean IsPeriodic() const = 0;

in Geom2d_Line class this method overrides:

  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;

OS: Windows

when it converted to C#, I have property in Geom2dCurve

public abstract bool IsPeriodic
{
     get;
}

but in Geom2dLine I have these two members:

        /// <summary>Returns False</summary>
        public virtual bool IsPeriodic()
        {
            var __slot = *(void**) ((IntPtr) __OriginalVTables[0] + 13 * 8);
            var ___IsPeriodicDelegate = (global::UniCad.Delegates.Func_bool_IntPtr) Marshal.GetDelegateForFunctionPointer(new IntPtr(__slot), typeof(global::UniCad.Delegates.Func_bool_IntPtr));
            var __ret = ___IsPeriodicDelegate((__Instance + __PointerAdjustment));
            return __ret;
        }

and this in same CS class:

public override bool IsPeriodic { get; }

There are two issues:

  1. We have property and method with same names
  2. Property not overrided correctly (as a minimum should return IsPeriodic() method, but issue 1 in this case)

What should I do in this case, can I solve it with custom pass or something?
Thanks.

Used headers

Geom2d_Line.hxx

Used settings

Target: MSVC

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions