newruntime: bugfixes

This commit is contained in:
Andreas Rumpf 2019-03-24 16:43:40 +01:00
commit 663b1f2c96
3 changed files with 8 additions and 2 deletions

View file

@ -1277,7 +1277,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
# prevent cascading errors:
result = nil
of tyOwned:
if t.len == 1 and t.sons[0].kind in {tyRef, tyPtr}:
if t.len == 1 and t.sons[0].skipTypes(abstractInst).kind in {tyRef, tyPtr, tyProc}:
result = typeAllowedAux(marker, t.lastSon, skVar, flags+{taHeap})
else:
result = t