twrong_sinkinference.nim 343 B

12345678910111213141516171819
  1. discard """
  2. cmd: "nim c --gc:arc $file"
  3. errormsg: "type mismatch: got <proc (a: string, b: sink string){.noSideEffect, gcsafe, locks: 0.}>"
  4. line: 18
  5. """
  6. type
  7. Foo = proc (a, b: string)
  8. proc take(x: Foo) =
  9. x("a", "b")
  10. proc willSink(a, b: string) = # {.nosinks.} =
  11. var arr: array[3, string]
  12. var x = a
  13. arr[0] = b
  14. take willSink