Implement language feature #6885 (#6954)

This commit is contained in:
cooldome 2017-12-25 00:22:03 +03:00 • committed by Andreas Rumpf
commit 2b3ec0a7c6
8 changed files with 131 additions and 14 deletions

View file

@ -0,0 +1,18 @@
discard """
ccodeCheck: "\\i @'__attribute__((noreturn))' .*"
"""
proc noret1*(i: int) {.noreturn.} =
echo i
var p {.used.}: proc(i: int): int
doAssert(not compiles(
p = proc(i: int): int {.noreturn.} = i # noreturn lambda returns int
))
doAssert(not compiles(
block:
noret1(5)
echo 1 # statement after noreturn
))