Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum constants are decompiled as their underlying type #94

Open
cervengoc opened this issue Jan 2, 2017 · 2 comments
Open

Enum constants are decompiled as their underlying type #94

cervengoc opened this issue Jan 2, 2017 · 2 comments

Comments

@cervengoc
Copy link
Contributor

It seems like decompiling an expression like this results loosing the enum type of the constant TestEnum.First, and having only an Int32 value of 1.

public enum TestEnum {
  None = 0,
  First = 1,
  Second = 2
}

public class Test {
  public TestEnum EnumProperty { get; set; }
  [Decompileable]
  public bool IsFirst { get { return EnumProperty == TestEnum.First; } }
}
@hazzik
Copy link
Owner

hazzik commented Jan 10, 2017

The compiler will create the same expression. There are tests which verify that.

@drielnox

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants