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
When a variant object is bound to a const, the latter fields are initalised to 0, which overwrites the former fields.
Example
typeKind=enum
A, B, C
Rocket=objectcase kind: Kind of A: a: int of B: b: int of C: c: intconst a =Rocket(kind: A, a: 20)
const b =Rocket(kind: B, b: 30)
const c =Rocket(kind: C, c: 40)
echo a
echo b
echo c
When a variant object is bound to a
const
, the latter fields are initalised to 0, which overwrites the former fields.Example
Current Output
Expected Output
Additional Information
This only seems to happen when using
const
i.e. the following are fine:
The text was updated successfully, but these errors were encountered: