bugfixes: objects still invalid for constants; fixed a typo concerning 'high' in eval context

This commit is contained in:
Araq 2011-11-15 23:03:14 +01:00
commit 7819b84475
8 changed files with 52 additions and 15 deletions

View file

@ -641,7 +641,7 @@ proc evalHigh(c: PEvalContext, n: PNode): PNode =
result = evalAux(c, n.sons[1], {})
if isSpecial(result): return
case skipTypes(n.sons[1].typ, abstractVar).kind
of tyOpenArray, tySequence: result = newIntNodeT(sonsLen(result), n)
of tyOpenArray, tySequence: result = newIntNodeT(sonsLen(result)-1, n)
of tyString: result = newIntNodeT(len(result.strVal) - 1, n)
else: InternalError(n.info, "evalHigh")