Size ptr tuple (#10846)

* fixes #10117
* Add support for recursive tuples
* detect in generics
This commit is contained in:
Arne Döring 2019-03-18 11:37:09 +01:00 • committed by Andreas Rumpf
commit 97c3b113a5
8 changed files with 153 additions and 10 deletions

View file

@ -272,14 +272,6 @@ proc computeSizeAlign(conf: ConfigRef; typ: PType) =
typ.align = szIllegalRecursion
return
# recursive tuplers are not allowed and should be detected in the frontend
if base.kind == tyTuple:
computeSizeAlign(conf, base)
if base.size < 0:
typ.size = base.size
typ.align = base.align
return
typ.align = int16(conf.target.ptrSize)
if typ.kind == tySequence and conf.selectedGC == gcDestructors:
typ.size = conf.target.ptrSize * 2