mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Exclude block from endsInNoReturn, fix regression (#22632)
Co-authored-by: SirOlaf <>
(cherry picked from commit d2f36c071b)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user