How to borrow the following procs?
type
AltString = distinct string
# compile error "no symbol to borrow from found"
proc add*(x: var AltString, y: string) {.borrow.}
proc `&=`*(x: var AltString, y: string) {.borrow.}
Good question. This should work. Bug report please. The workaround is obvious though, right?
proc add*(x: var AltString; y: string) = system.add(string(x), y)
Oh, type conversions from a distinct type to its base type and vice versa are not done by COPY (but cast)"?
Anyway, the workaround works well. Thanks! I will post this issue on the github, soon.