mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-27 01:34:02 +00:00
19 lines
333 B
Nim
19 lines
333 B
Nim
discard """
|
|
cmd: "nim c --gc:arc $file"
|
|
errormsg: "type mismatch: got <proc (a: string, b: sink string){.noSideEffect, gcsafe.}>"
|
|
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
|