mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
(cherry picked from commit a3a87cdb29)
This commit is contained in:
@@ -545,6 +545,10 @@ proc magicsAfterOverloadResolution(c: PContext, n: PNode,
|
||||
let constructed = result[1].typ.base
|
||||
if constructed.requiresInit:
|
||||
message(c.config, n.info, warnUnsafeDefault, typeToString(constructed))
|
||||
of mPred:
|
||||
if n[1].typ.skipTypes(abstractInst).kind in {tyUInt..tyUInt64}:
|
||||
n[0].sym.magic = mSubU
|
||||
result = n
|
||||
else:
|
||||
result = n
|
||||
|
||||
|
||||
@@ -65,3 +65,13 @@ discard $(x1,)
|
||||
# bug 13698
|
||||
let n: csize = 1
|
||||
echo n.int32
|
||||
|
||||
# bug #14616
|
||||
|
||||
let limit = 1'u64
|
||||
|
||||
let rangeVar = 0'u64 ..< limit
|
||||
|
||||
doAssert repr(rangeVar) == """[a = 0,
|
||||
b = 0]
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user