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

error occur when using "dynamic" and "enum" #14

Open
sericaer opened this issue Aug 3, 2018 · 1 comment
Open

error occur when using "dynamic" and "enum" #14

sericaer opened this issue Aug 3, 2018 · 1 comment

Comments

@sericaer
Copy link

sericaer commented Aug 3, 2018

When I used the "dynamic" and "enum" as follow:
class DynamicEnum
{
enum TEST
{
t1
}

    TEST _test;

    void Selected(dynamic param)
    {
        _test = param;
    }
}

I got an error without useful info:
error : 10(18,14): native.DynamicEnum.Selected(dynamic)
UnityEngine.Debug:Log(Object)
CSharpCompiler.UnityLogTextWriter:Log(String) (at Assets/ThridParty/mcs_ICodeCompiler/UnityLogTextWriter.cs:19)
CSharpCompiler.SourceCodeBundle:.ctor(ScriptBundleLoader, IEnumerable1) (at Assets/ThridParty/mcs_ICodeCompiler/ScriptBundleLoader.cs:227) CSharpCompiler.ScriptBundleLoader:LoadAndWatchSourceBundle(IEnumerable1) (at Assets/ThridParty/mcs_ICodeCompiler/ScriptBundleLoader.cs:41)

But if change the type of _test as "string", the error is disappeared

@thpetsen
Copy link

thpetsen commented Aug 4, 2018

Does your code work anywhere else ?
How about Enum.Parse, usually you can not cast enum's directly, not in C# at least,
Cheers,

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