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 7536d7f94a
commit 9ad184841e
2 changed files with 1 additions and 14 deletions

View File

@@ -219,7 +219,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 =