You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below assigns a value of Enum2 to a local of Enum1, causing unexpected runtime results. Instead, an error should be reported. Similar issue exists for passing ENUMs of different type to method params etc.
ENUM Enum1
MEMBER m1
MEMBER m2
END ENUM
ENUM Enum2
MEMBER m2
MEMBER m1
END ENUM
FUNCTION Start() AS VOID
LOCAL e AS Enum1
e := Enum2.m1
? e:ToString() // m2
RETURN
The text was updated successfully, but these errors were encountered:
Vulcan allowed to "silently" (Implicitely) convert Integer values to enums and also do Add and Subtract operations on enums.
We have added similar functionality to the compiler. I think this is a side effect of this.
I would not mind removing the implicit conversions from int to enum and back and I am almost sure that this will then also be fixed.
Explicit casts between Int and Enum will always work.
Yes, those implicit conversions can be handly, but are also very dangerous. Indeed the same problem existed in vulcan as well. I suggest we do it in RC3, before the final release and see the responses. I will take care of explaining in details why this HAD to be done.
The code below assigns a value of Enum2 to a local of Enum1, causing unexpected runtime results. Instead, an error should be reported. Similar issue exists for passing ENUMs of different type to method params etc.
The text was updated successfully, but these errors were encountered: