mcs-ICodeCompiler
mcs-ICodeCompiler copied to clipboard
error occur when using "dynamic" and "enum"
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(IEnumerable
1) (at Assets/ThridParty/mcs_ICodeCompiler/ScriptBundleLoader.cs:41)
But if change the type of _test as "string", the error is disappeared
Does your code work anywhere else ? How about Enum.Parse, usually you can not cast enum's directly, not in C# at least, Cheers,