vrchat-community / UdonSharp

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

fix enum cast #153

Open ureishi opened 10 months ago

ureishi commented 10 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