parent
707367e1ca
commit
d9e907c0e2
6 changed files with 36 additions and 7 deletions
|
|
@ -46,7 +46,7 @@ type
|
|||
proc `=destroy`(x: var AObj) =
|
||||
close(x.io)
|
||||
echo "closed"
|
||||
|
||||
|
||||
var x = B(io: newStringStream("thestream"))
|
||||
|
||||
|
||||
|
|
@ -64,4 +64,14 @@ proc main() =
|
|||
cryptCTR(nonce2.toOpenArray(0, nonce2.len-1))
|
||||
doAssert(nonce2 == "0A234567")
|
||||
|
||||
main()
|
||||
main()
|
||||
|
||||
# bug #14079
|
||||
import std/algorithm
|
||||
|
||||
let
|
||||
n = @["c", "b"]
|
||||
q = @[("c", "2"), ("b", "1")]
|
||||
|
||||
assert n.sortedByIt(it) == @["b", "c"], "fine"
|
||||
assert q.sortedByIt(it[0]) == @[("b", "1"), ("c", "2")], "fails under arc"
|
||||
|
|
|
|||
18
tests/arc/twrong_sinkinference.nim
Normal file
18
tests/arc/twrong_sinkinference.nim
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue