better support for view types (#15436)
* you can put borrows into tables * enforces mutating views only mutate mutable data
This commit is contained in:
parent
9c86f4867e
commit
86d7b63e2a
5 changed files with 139 additions and 11 deletions
|
|
@ -121,7 +121,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
|
|||
{tyChar, tyEnum, tyInt..tyFloat128, tyInt..tyUInt64}: result = t
|
||||
of tyOpenArray:
|
||||
# you cannot nest openArrays/sinks/etc.
|
||||
if (kind != skParam and views notin c.features) or taIsOpenArray in flags:
|
||||
if (kind != skParam or taIsOpenArray in flags) and views notin c.features:
|
||||
result = t
|
||||
else:
|
||||
result = typeAllowedAux(marker, t[0], kind, c, flags+{taIsOpenArray})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue