allow 'mixin' in generics
This commit is contained in:
parent
8717742f00
commit
9bbf56bdbb
6 changed files with 84 additions and 80 deletions
|
|
@ -144,11 +144,17 @@ proc objectInit(dest: Pointer, typ: PNimType) =
|
|||
|
||||
# ---------------------- assign zero -----------------------------------------
|
||||
|
||||
# dummy declaration; XXX we need 'mixin' here
|
||||
proc destroy(x: int) = nil
|
||||
proc nimDestroyRange*[T](r: T) =
|
||||
# internal proc used for destroying sequences and arrays
|
||||
for i in countup(0, r.len - 1): destroy(r[i])
|
||||
when not defined(nimmixin):
|
||||
proc destroy(x: int) = nil
|
||||
proc nimDestroyRange*[T](r: T) =
|
||||
# internal proc used for destroying sequences and arrays
|
||||
for i in countup(0, r.len - 1): destroy(r[i])
|
||||
else:
|
||||
# XXX Why is this exported and no compilerproc?
|
||||
proc nimDestroyRange*[T](r: T) =
|
||||
# internal proc used for destroying sequences and arrays
|
||||
mixin destroy
|
||||
for i in countup(0, r.len - 1): destroy(r[i])
|
||||
|
||||
proc genericReset(dest: Pointer, mt: PNimType) {.compilerProc.}
|
||||
proc genericResetAux(dest: Pointer, n: ptr TNimNode) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue