Files
Nim/tests/ccgbugs/tborrowmagic.nim
LemonBoy 8670f4911b Fix semantic pass with borrowed magic procs (#8945)
Reported by pqflx3 on the forum.
2018-09-11 20:32:25 +02:00

9 lines
177 B
Nim

type
Bytes = distinct seq[byte]
proc add(x: var Bytes; b: byte) {.borrow.}
var x = @[].Bytes
x.add(42)
let base = cast[seq[byte]](x)
doAssert base.len == 1 and base[0] == 42