Deprecated laxStrings for mutating the internal zero terminator on strings and its Deprecated code cleaned out (#14766)

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Juan Carlos 2020-06-23 08:20:53 -03:00 • committed by GitHub
commit 28510a9da9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 4 additions and 9 deletions

View file

@ -482,8 +482,6 @@ proc foldArrayAccess(m: PSym, n: PNode; g: ModuleGraph): PNode =
result = newNodeIT(nkCharLit, x.info, n.typ)
if idx >= 0 and idx < x.strVal.len:
result.intVal = ord(x.strVal[int(idx)])
elif idx == x.strVal.len and optLaxStrings in g.config.options:
discard
else:
localError(g.config, n.info, formatErrorIndexBound(idx, x.strVal.len-1) & $n)
else: discard