Enum operator >= gives wrong results in a specific case.
Puppet~
It seems like the operator ">=" acts like ">" and therefore gives wrong results. But only when one of the comparisons is a variable. I think the example below explains it better than words.
Define Example enum:
public enum TestEnum
{
ONE,
TWO
}
Then call:
var max = TestEnum.TWO;
max >= TestEnum.TWO;
The result will be FALSE, and not TRUE like it should be.
Conversely, this results in TRUE correctly:
(int)max >= (int)TestEnum.TWO;
And this works too:
TestEnum.TWO >= TestEnum.TWO;
Log In
Jar
I think I ran into this too, thought I was crazy
vavassor
Tested this in VRCSDK 3.7.5 and >= is incorrectly compiled into
EXTERN, "SystemInt32.__op_Inequality__SystemInt32_SystemInt32__SystemBoolean"
Also found a github issue reporting the same. https://github.com/vrchat-community/UdonSharp/issues/68