fixes #14079 [backport:1.2] (#14163)

This commit is contained in:
Andreas Rumpf 2020-04-29 21:58:59 +02:00 • committed by GitHub
commit d9e907c0e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 7 deletions

View file

@ -0,0 +1,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