mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-29 10:01:39 +00:00
Quick Fix:
Constant expressions used in when statements and tuple indexing are properly evaluated now Even further step tested to be OK: ```nimrod proc semConstExpr(c: PContext, n: PNode): PNode = result = semAndEvalConstExpr(c, n) ```
This commit is contained in:
@@ -747,7 +747,7 @@ proc semSubscript(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||
checkSonsLen(n, 2)
|
||||
n.sons[0] = makeDeref(n.sons[0])
|
||||
# [] operator for tuples requires constant expression:
|
||||
n.sons[1] = semConstExpr(c, n.sons[1])
|
||||
n.sons[1] = semAndEvalConstExpr(c, n.sons[1])
|
||||
if skipTypes(n.sons[1].typ, {tyGenericInst, tyRange, tyOrdinal}).kind in
|
||||
{tyInt..tyInt64}:
|
||||
var idx = getOrdValue(n.sons[1])
|
||||
|
||||
Reference in New Issue
Block a user