Exclude block from endsInNoReturn, fix regression (#22632)

Co-authored-by: SirOlaf <>
This commit is contained in:
SirOlaf
2023-09-02 20:42:40 +02:00
committed by GitHub
parent bd6adbcc9d
commit d2f36c071b
2 changed files with 1 additions and 14 deletions

View File

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