Archived

This forum has been archived. Please start a new discussion on GitHub.

slice2cs enum bug when in another namespace

I found a bug of slice2cs in below case:

1. define an enum in namespace A:
module A
{
enum EStatus
{
eInit,
eReady,
};
};

2. Use this enum in a structure of another namespace:
module B
{
struct STest
{
A::EStatus eStatus = A::eInit;

string strName;//to force slice2cs generate a class definition
};
};

Then slice2cs generates an incorrect default constructor of the class STest where the enum is used:

[_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.4.1")] public STest() {
this.eStatus = A.EStatus.A::eInit;
}

Please evaluate this issue and get it fixed if needed.

Thanks for the support.

Comments

  • mes
    mes California
    Thanks, this will be fixed in the next release.

    Regards,
    Mark