summary refs log tree commit diff stats
path: root/tests/reject/tsidee4.nim
blob: cbebfbd369444075dd105b71686f9880ccf82ef8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  file: "tsidee4.nim"
  line: 15
  errormsg: "type mismatch"
"""

var
  global: int

proc dontcare(x: int): int = 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) #ERROR_MSG type mismatch