* fixes #16069; refs https://github.com/nim-lang/RFCs/issues/257 [backport:1.2] [backport:1.4] * make tests green again
This commit is contained in:
parent
1d14b2c9e6
commit
d306a04466
8 changed files with 29 additions and 15 deletions
|
|
@ -1122,7 +1122,7 @@ proc safeLen*(n: PNode): int {.inline.} =
|
|||
|
||||
proc safeArrLen*(n: PNode): int {.inline.} =
|
||||
## works for array-like objects (strings passed as openArray in VM).
|
||||
if n.kind in {nkStrLit..nkTripleStrLit}:result = n.strVal.len
|
||||
if n.kind in {nkStrLit..nkTripleStrLit}: result = n.strVal.len
|
||||
elif n.kind in {nkNone..nkFloat128Lit}: result = 0
|
||||
else: result = n.len
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue