ensure the Nim compiler works with --experimental:strictFuncs --experimental:views [backport:1.4] (#15737)

This commit is contained in:
Andreas Rumpf 2020-10-26 21:08:57 +01:00 • committed by GitHub
commit cf01945f54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,4 @@
discard """
cmd: "nim check --hints:on --experimental:strictFuncs --experimental:views compiler/nim.nim"
action: "compile"
"""

View file

@ -46,3 +46,14 @@ proc main() =
echo i, ": ", x
main()
# This has to continue to work:
type
PNode = ref object
TSrcGen = object
comStack: seq[PNode]
proc pushCom(g: var TSrcGen, n: PNode) =
setLen(g.comStack, g.comStack.len + 1)
g.comStack[^1] = n