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

Multiple issues with Enums #243

Closed
msonnemans opened this issue Sep 2, 2019 · 2 comments
Closed

Multiple issues with Enums #243

msonnemans opened this issue Sep 2, 2019 · 2 comments

Comments

@msonnemans
Copy link
Contributor

  1. Enum.lua gets the type of variable TEnum at line 161 but TEnum is already a type if the Enum.TryParse(Type type, ...) methos variant is used. Therefore the exception at line 56 is always thrown.

  2. Enum.IsDefined errors with `String.lua:172: bad argument var arr = new[] { 1, 2, 3, 4 };语法的支持 #1 to 'find' (string expected got boolean)

  3. If the enum is defined in a different module, all of the above methods don't work anymore because the type parameter is nil.

Example:

            string a = "andre";
            if (Enum.TryParse(typeof(PedModel), a, true, out object b))
                Console.WriteLine((int)b);

With PedModel defined in a different module, it is always nil and the assertions fail.

@yanghuan
Copy link
Owner

yanghuan commented Sep 3, 2019

add argument "-e" for solve 3

@yanghuan
Copy link
Owner

yanghuan commented Sep 3, 2019

Question 2 I didn't konw it, could you provide more detailed information?

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

No branches or pull requests

2 participants