mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
allows cast int to bool/enum in VM (#22809)
Since they are integer types, by mean of allowing cast integer to enums in VM, we can suppress some enum warnings in the stdlib in the unified form, namely using a cast expression.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user