views: yet another bugfix (#15447)

* views: yet another bugfix

* views: extended the spec

* views: take into account potential hidden mutations via proc calls
This commit is contained in:
Andreas Rumpf 2020-10-01 15:04:36 +02:00 • committed by GitHub
commit ab405c936e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 10 deletions

View file

@ -190,3 +190,8 @@ proc getRoot*(n: PNode): PSym =
of nkCallKinds:
if getMagic(n) == mSlice: result = getRoot(n[1])
else: discard
proc stupidStmtListExpr*(n: PNode): bool =
for i in 0..<n.len-1:
if n[i].kind notin {nkEmpty, nkCommentStmt}: return false
result = true