Fix semantic pass with borrowed magic procs (#8945)
Reported by pqflx3 on the forum.
This commit is contained in:
parent
e7d4043406
commit
8670f4911b
2 changed files with 11 additions and 0 deletions
8
tests/ccgbugs/tborrowmagic.nim
Normal file
8
tests/ccgbugs/tborrowmagic.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue