Hi to everybody,
It is not clear to me how to declare an empty clause in a object case section:
type
Kind = enum
kNone, kInt, kFloat
value = object
case k : Kind
of kNone: # None here
of kInt: intVal : int
of kFloat: floatVal : float
This produces the error:
test.nim(8, 10) Error: identifier expected, but found 'keyword of'
If I put a discard after of true:, I get this error:
test.nim(7, 25) Error: identifier expected, but found 'keyword discard'
What is the correct syntax to use in this case?
type
Kind = enum
kNone, kInt, kFloat
value = object
case k : Kind
of kNone: nil
of kInt: intVal : int
of kFloat: floatVal : float