EndsInNoReturn in expressions extension, fixes #13490 (#13520)

* fix #13490
This commit is contained in:
cooldome 2020-02-28 09:55:06 +00:00 • committed by GitHub
commit c79df2fb6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 8 deletions

View file

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