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
In case I didn't miss anything, it is currently not possible to create an enum instance from a raw integer.
If the values of enum instances should matter at all (which is suggested by the possibility to assign custom values to specific enum members, and by the existence of get_raw_value()), then I believe it should also be possible to create an enum instance from an integer.
In case I didn't miss anything, it is currently not possible to create an enum instance from a raw integer.
If the values of enum instances should matter at all (which is suggested by the possibility to assign custom values to specific enum members, and by the existence of
get_raw_value()), then I believe it should also be possible to create an enum instance from an integer.A specific use case I have in mind:
Ways to make something like this possible could be:
operator= : (implicit out this, _val: i64)public.Square::from_raw_value(val: i64)) to make clear that converting an integer into an enum is an unusual/dangerous operation