Describe the bug in detail:
Doing a range comparison (such as less-than-or-equal) for an enum value without explicit int casting incorrectly compiles to the SystemInt32.__op_Inequality__SystemInt32_SystemInt32__SystemBoolean extern.
Provide steps/code to reproduce the bug:
Create a C# script with the following code and the examine the compiled UASM:
namespace BugTesting
{
public enum TestLevel { ZERO, ONE, TWO}
public class EnumComparators : UdonSharp.UdonSharpBehaviour
{
public TestLevel level;
private void Start()
{
bool _ = TestLevel.ONE <= level;
_ = (int)TestLevel.ONE <= (int)level;
}
}
}
Expected behavior:
Enums are always treated as ints within udon, so the comparison should match the respective comparison extern, such as SystemInt32.__op_LessThanOrEqual__SystemInt32_SystemInt32__SystemBoolean
Describe the bug in detail: Doing a range comparison (such as less-than-or-equal) for an enum value without explicit int casting incorrectly compiles to the
SystemInt32.__op_Inequality__SystemInt32_SystemInt32__SystemBoolean
extern.Provide steps/code to reproduce the bug: Create a C# script with the following code and the examine the compiled UASM:
Outputs:
Expected behavior: Enums are always treated as ints within udon, so the comparison should match the respective comparison extern, such as
SystemInt32.__op_LessThanOrEqual__SystemInt32_SystemInt32__SystemBoolean