Open
Description
Description
type Bit {.pure.} = enum
A
B
static:
echo cast[int]({A, B})
Nim Version
Nim Compiler Version 2.0.0 [Android: arm64] Compiled at 2023-08-01
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: a488067 active boot switches: -d:release -d:danger
Current Output
Error: VM does not support 'cast' from tySet to tyInt
Expected Output
3
Possible Solution
Add opcCastSetToInt(opcCastSetToInt32, opcCastSetToInt64) opcodes to vmdef and impl it in vm
Additional Information
simple vm workaround:
var bitmask = 0
for i in mySet:
bitmask += 1 shl i.ord