mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 22:13:29 +00:00
isDeepConstExpr helper can handle nkRange
This commit is contained in:
@@ -96,7 +96,7 @@ proc isDeepConstExpr*(n: PNode): bool =
|
||||
result = true
|
||||
of nkExprEqExpr, nkExprColonExpr, nkHiddenStdConv, nkHiddenSubConv:
|
||||
result = isDeepConstExpr(n.sons[1])
|
||||
of nkCurly, nkBracket, nkPar, nkObjConstr, nkClosure:
|
||||
of nkCurly, nkBracket, nkPar, nkObjConstr, nkClosure, nkRange:
|
||||
for i in ord(n.kind == nkObjConstr) .. <n.len:
|
||||
if not isDeepConstExpr(n.sons[i]): return false
|
||||
if n.typ.isNil: result = true
|
||||
|
||||
Reference in New Issue
Block a user