mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-10 15:04:59 +00:00
9 lines
177 B
Nim
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
|