MerlinVR / UdonSharp

An experimental compiler for compiling C# to Udon assembly
MIT License
678 stars 89 forks source link

Re-add some exceptions so that the compiler doesn't silently fail #25

Closed MerlinVR closed 3 years ago

MerlinVR commented 4 years ago

Re-add some exceptions so that the compiler doesn't silently skip copying a value instead of throwing an exception since something is wrong. @bdunderscore is there a reason that these should be left out? I noticed they were removed in the COW changes.

bdunderscore commented 4 years ago

Hmm. If this returns null, it should end up falling back to ExecuteSet (which, in fact, always gets a chance to run, but will no-op on a self-copy). I think I assumed the checks would be there - and they probably should be there, as destinationSymbolForSet is a hint which can be ignored.

That being said, compile errors are hard to test for since they'll break the unity .net assembly build in unity.

bdunderscore commented 4 years ago

https://github.com/Merlin-san/UdonSharp/blob/0961f9e9eb53656d5c28d6ee86e4bb6c9b8509f8/Assets/UdonSharp/Editor/UdonSharpExpressionCapture.cs#L546

This section of ExecuteSet should probably be changed to not execute for things which can't be set.

MerlinVR commented 3 years ago

Closing since I never got around to this in its current form.