fixes #15280 [backport:1.2] (#15281)

* fixes #15280 [backport:1.2]

* make tests green again

* adapt tests

(cherry picked from commit 3f00a738db)
This commit is contained in:
Andreas Rumpf
2020-09-09 14:20:10 +02:00
committed by narimiran
parent 0845e88110
commit 7bba0deb1d
3 changed files with 46 additions and 2 deletions

View File

@@ -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 or
result = it.kind in (nkLastBlockStmts-{nkReturnStmt}) or
it.kind in nkCallKinds and it[0].kind == nkSym and sfNoReturn in it[0].sym.flags
proc commonType*(x: PType, y: PNode): PType =