cleanup destructor building for arrays; still doesn't work

This commit is contained in:
Araq 2015-08-18 13:57:37 +02:00
commit d634da775d
3 changed files with 15 additions and 27 deletions

View file

@ -24,7 +24,6 @@ var
destructorName = getIdent"destroy_"
destructorParam = getIdent"this_"
destructorPragma = newIdentNode(getIdent"destructor", unknownLineInfo())
rangeDestructorProc*: PSym
proc instantiateDestructor(c: PContext, typ: PType): PType
@ -141,9 +140,7 @@ proc instantiateDestructor(c: PContext, typ: PType): PType =
case t.kind
of tySequence, tyArray, tyArrayConstr, tyOpenArray, tyVarargs:
if instantiateDestructor(c, t.sons[0]) != nil:
if rangeDestructorProc == nil:
rangeDestructorProc = searchInScopes(c, getIdent"nimDestroyRange")
t.destructor = rangeDestructorProc
t.destructor = getCompilerProc"nimDestroyRange"
return t
else:
return nil