* fixes #20031; uint64 is an ordinal type since 1.0 * Update compiler/semstmts.nim
This commit is contained in:
parent
4c46358db1
commit
5bbc5edf43
2 changed files with 12 additions and 1 deletions
|
|
@ -1050,7 +1050,7 @@ proc semCase(c: PContext, n: PNode; flags: TExprFlags): PNode =
|
||||||
var typ = commonTypeBegin
|
var typ = commonTypeBegin
|
||||||
var hasElse = false
|
var hasElse = false
|
||||||
let caseTyp = skipTypes(n[0].typ, abstractVar-{tyTypeDesc})
|
let caseTyp = skipTypes(n[0].typ, abstractVar-{tyTypeDesc})
|
||||||
const shouldChckCovered = {tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt32, tyBool}
|
const shouldChckCovered = {tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt64, tyBool}
|
||||||
case caseTyp.kind
|
case caseTyp.kind
|
||||||
of shouldChckCovered:
|
of shouldChckCovered:
|
||||||
chckCovered = true
|
chckCovered = true
|
||||||
|
|
|
||||||
|
|
@ -287,3 +287,14 @@ doAssert(foo2("Y", "a2") == 0)
|
||||||
doAssert(foo2("Y", "2a") == 2)
|
doAssert(foo2("Y", "2a") == 2)
|
||||||
doAssert(foo2("N", "a3") == 3)
|
doAssert(foo2("N", "a3") == 3)
|
||||||
doAssert(foo2("z", "2") == 0)
|
doAssert(foo2("z", "2") == 0)
|
||||||
|
|
||||||
|
|
||||||
|
# bug #20031
|
||||||
|
proc main(a: uint64) =
|
||||||
|
case a
|
||||||
|
else:
|
||||||
|
discard
|
||||||
|
|
||||||
|
static:
|
||||||
|
main(10)
|
||||||
|
main(10)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue