summary refs log tree commit diff stats
path: root/tests/accept/run/tsidee3.nim
blob: e0c427ab6c3a684be7a77ef39f40b006c3ad71a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  file: "tsidee3.nim"
  output: "5"
"""

var
  global: int

proc dontcare(x: int): int {.noSideEffect.} = return x

proc noSideEffect(x, y: int, p: proc (a: int): int {.noSideEffect.}): int {.noSideEffect.} = 
  return x + y + dontcare(x)
  
echo noSideEffect(1, 3, dontcare) #OUT 5