destructors: preparations for upcoming changes

This commit is contained in:
Araq 2017-10-17 12:46:49 +02:00
commit 45d74f4081
8 changed files with 27 additions and 8 deletions

View file

@ -363,11 +363,7 @@ proc handleGenericInvocation(cl: var TReplTypeVars, t: PType): PType =
# '=' needs to be instantiated for generics when the type is constructed:
newbody.field = cl.c.instTypeBoundOp(cl.c, opr, result, cl.info,
attachedAsgn, 1)
# we need to produce the destructor first here because generated '='
# and '=sink' operators can rely on it:
if newDestructors: typeBound(destructor)
typeBound(assignment)
typeBound(sink)
if not newDestructors: typeBound(assignment)
let methods = skipTypes(bbody, abstractPtrs).methods
for col, meth in items(methods):
# we instantiate the known methods belonging to that type, this causes