Values of long enums are not generated correctly

Issue #132 new
Stuart Marshall
created an issue

Hey,

I have a flags enum of type long. When I generate a list the values in the TS enum are 32 bit numbers. Therefore I lose my values over 1 << 30.

This CS:

    [TypeLite.TsEnum(Module = "BigNumberEnumModule")]
    [Flags]
    public enum BigNumberEnum : long
    {
        A = 1 << 29,
        B = 1 << 30,
        C = 1 << 31,
        D = 1 << 32,
        E = 1 << 33,
    }

Generates this TS:

namespace BigNumberEnumModule {
    export const enum BigNumberEnum {
        A = 536870912,
        B = 1073741824,
        C = -2147483648,
        D = 1,
        E = 2
    }
}

Comments (0)

  1. Log in to comment