Hey everyone,
I’m experiencing an internal compiler error when including any try/catch in a coroutine, it seems to reproduce no matter what the case.
I managed to reproduce it by simply creating a new, completely blank unity project (using Unity 5.2.2f1, and VS2010), adding a script to the main camera and adding this method to the class:
public System.Collections.IEnumerator TestCoroutine() {
try{}
catch (System.Exception e){}
yield break;
}
This causes the console to be flooded with text, but the two important lines (I think) are these:
Unhandled Exception: System.ArgumentException: Trying to emit a local from a different ILGenerator.
Internal compiler error at Assets/dawdwd.cs(11,43):: exception caught while emitting MethodBuilder [<TestCoroutine>c__Iterator0::MoveNext]
I’ve searched both google and these forums and while it seems that others are experiencing the same issue, I’ve found no solution. I apologize if the answer is actually out there and I couldn’t find it, but what I’m mainly wanting to know is: Is this a widespread issue or is it only me and a few others that are experiencing this problem?
Any help is greatly appreciated!