summary refs log tree commit diff stats
path: root/tests/arc/twrong_sinkinference.nim
blob: 59930a9fada75e361353566c95ee174b2eb04d43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
  cmd: "nim c --gc:arc $file"
  errormsg: "type mismatch: got <proc (a: string, b: sink string){.noSideEffect, gcsafe, locks: 0.}>"
  line: 18
"""

type
  Foo = proc (a, b: string)

proc take(x: Foo) =
  x("a", "b")

proc willSink(a, b: string) = # {.nosinks.} =
  var arr: array[3, string]
  var x = a
  arr[0] = b

take willSink