slice2cs enum bug when in another namespace

linkmanlinkman Member liao changbinOrganization: huhan universityProject: scada
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

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Thanks, this will be fixed in the next release.

    Regards,
    Mark
Sign In or Register to comment.