Careful with those variable length tuples

This commit is contained in:
Emery Hemingway 2021-12-24 00:38:02 +01:00
parent e25e06efba
commit ba4d567791
1 changed files with 7 additions and 6 deletions

View File

@ -882,6 +882,7 @@ proc fromPreserve*[T, E](v: var T; pr: Preserve[E]): bool =
var i: int
for name, field in fieldPairs(v):
when v.dot(name).hasCustomPragma(preservesTupleTail):
if pr.len >= i:
setLen(v.dot(name), pr.len - i)
var j: int
while result and i < pr.len: