summary refs log tree commit diff stats
path: root/tests/ccgbugs/tescaping_temps.nim
blob: ef078913bf9aebc02ad93c1e2128f4be466b2821 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# bug #4505

proc f(t: tuple[]) = discard
f((block: ()))

# bug #4230
# If we make `test` function return nothing - the bug disappears
proc test(dothejob: proc()): int {.discardable.} =
    dothejob()

test proc() =
    let f = 15
    if f > 10:
        test proc() = discard
    # If we remove elif branch of the condition - the bug disappears
    elif f < 3:
        test proc() = discard
    else:
        test proc() = discard