blob: 11c8595ebf35eb1fdefe8a92de1c7ded4df6c0ee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
discard """
cmd: "nim check --warningAsError:UnreachableCode $file"
action: "reject"
nimout: '''
tunreachable.nim(23, 3) Error: unreachable code after 'return' statement or '{.noReturn.}' proc [UnreachableCode]
tunreachable.nim(30, 3) Error: unreachable code after 'return' statement or '{.noReturn.}' proc [UnreachableCode]
'''
"""
# bug #9839
template myquit1():untyped=
## foo
quit(1)
template myquit2():untyped=
echo 123
myquit1()
proc main1()=
# BUG: uncommenting this doesn't give `Error: unreachable statement`
myquit2()
echo "after"
main1()
proc main2() =
myquit1()
echo "after"
main2()
|