diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 2e54812a05..03265f5b55 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -904,9 +904,9 @@ proc genCard(c: PCtx; n: PNode; dest: var TDest) = c.freeTemp(tmp) proc genCastIntFloat(c: PCtx; n: PNode; dest: var TDest) = - const allowedIntegers = {tyInt..tyInt64, tyUInt..tyUInt64, tyChar} + const allowedIntegers = {tyInt..tyInt64, tyUInt..tyUInt64, tyChar, tyEnum, tyBool} var signedIntegers = {tyInt..tyInt64} - var unsignedIntegers = {tyUInt..tyUInt64, tyChar} + var unsignedIntegers = {tyUInt..tyUInt64, tyChar, tyEnum, tyBool} let src = n[1].typ.skipTypes(abstractRange)#.kind let dst = n[0].typ.skipTypes(abstractRange)#.kind let srcSize = getSize(c.config, src)