added toOpenArray builtin for zero-copy slices; syntax sugar yet to come
This commit is contained in:
parent
121b9e26fb
commit
1d9343080d
6 changed files with 84 additions and 14 deletions
|
|
@ -346,7 +346,9 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
|
|||
if c.inGenericContext == 0:
|
||||
instantiateBody(c, n, fn.typ.n, result, fn)
|
||||
sideEffectsCheck(c, result)
|
||||
paramsTypeCheck(c, result.typ)
|
||||
if result.magic != mSlice:
|
||||
# 'toOpenArray' is special and it is allowed to return 'openArray':
|
||||
paramsTypeCheck(c, result.typ)
|
||||
else:
|
||||
result = oldPrc
|
||||
popProcCon(c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue