diff --git a/compiler/sem.nim b/compiler/sem.nim index 0be4337287..9fc13d6224 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -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 diff --git a/tests/exprs/t22604.nim b/tests/exprs/t22604.nim index 570f989d64..c41cd3dfa2 100644 --- a/tests/exprs/t22604.nim +++ b/tests/exprs/t22604.nim @@ -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 =