vrchat-community / UdonSharp

A compiler for compiling C# to Udon assembly
https://udonsharp.docs.vrchat.com
MIT License
461 stars 50 forks source link

fix enum cast #153

Open ureishi opened 6 months ago

ureishi commented 6 months ago

The following cast from integer 3 to TextureWrapMode will compile, but will result in an error at runtime.

code:

TextureWrapMode mode = (TextureWrapMode)3;

result: Udon runtime exception detected! An exception occurred during EXTERN to 'SystemObjectArray.GetSystemInt32__SystemObject'. Parameter Addresses: 0x00000005, 0x00000004, 0x00000007