Exclude block from endsInNoReturn, fix regression (#22632)

Co-authored-by: SirOlaf <>
(cherry picked from commit d2f36c071b)
This commit is contained in:
SirOlaf
2023-09-02 20:42:40 +02:00
committed by narimiran
parent ce8d9dd1cb
commit 246267aa52
2 changed files with 1 additions and 14 deletions

View File

@@ -213,7 +213,7 @@ proc endsInNoReturn(n: PNode): bool =
var it = n
# skip these beforehand, no special handling needed
while it.kind in {nkStmtList, nkStmtListExpr, nkBlockStmt} and it.len > 0:
while it.kind in {nkStmtList, nkStmtListExpr} and it.len > 0:
it = it.lastSon
case it.kind

View File

@@ -10,19 +10,6 @@ for i in 0..<1:
else:
raiseAssert "Won't get here"
# block
for i in 0..<1:
let x =
case false
of true:
42
of false:
block:
if true:
continue
else:
raiseAssert "Won't get here"
# nested case
for i in 0..<1:
let x =