From 00cd7b8ca42b2219380674e1af01ec4f72e48120 Mon Sep 17 00:00:00 2001 From: Clyybber Date: Sat, 24 Oct 2020 11:45:18 +0200 Subject: [PATCH] Revert "fixes #15280 [backport:1.2] (#15281)" (#15700) This reverts commit 3f00a738dbc8319b4dd2b86bf5529c096f2dd243. (cherry picked from commit d4022ebe53062a7e1be5fd55637a3cce39b93a12) --- compiler/sem.nim | 2 +- tests/casestmt/tcasestmt.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/sem.nim b/compiler/sem.nim index e2ffc13089..1ced234f57 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -183,7 +183,7 @@ proc endsInNoReturn(n: PNode): bool = var it = n while it.kind in {nkStmtList, nkStmtListExpr} and it.len > 0: it = it.lastSon - result = it.kind in (nkLastBlockStmts-{nkReturnStmt}) or + result = it.kind in nkLastBlockStmts or it.kind in nkCallKinds and it[0].kind == nkSym and sfNoReturn in it[0].sym.flags proc commonType*(x: PType, y: PNode): PType = diff --git a/tests/casestmt/tcasestmt.nim b/tests/casestmt/tcasestmt.nim index 8c6ce7a389..6abea53bc6 100644 --- a/tests/casestmt/tcasestmt.nim +++ b/tests/casestmt/tcasestmt.nim @@ -258,7 +258,7 @@ func foo(input: string): int = try: parseInt(input) except: - 0 + return func foo2(b, input: string): int = case b: