summary refs log tree commit diff stats
path: root/compiler/semtypinst.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semtypinst.nim')
-rw-r--r--compiler/semtypinst.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim
index 9c15be635..e069064c2 100644
--- a/compiler/semtypinst.nim
+++ b/compiler/semtypinst.nim
@@ -291,8 +291,9 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType =
 
   var newbody = replaceTypeVarsT(cl, lastSon(body))
   newbody.flags = newbody.flags + (t.flags + body.flags - tfInstClearedFlags)
-  result.flags = result.flags + newbody.flags
-  newbody.callConv = body.callConv
+  result.flags = result.flags + newbody.flags - tfInstClearedFlags
+  # This is actually wrong: tgeneric_closure fails with this line:
+  #newbody.callConv = body.callConv
   # This type may be a generic alias and we want to resolve it here.
   # One step is enough, because the recursive nature of
   # handleGenericInvokation will handle the alias-to-alias-to-alias case
@@ -306,6 +307,8 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType =
     newbody.deepCopy = cl.c.instDeepCopy(cl.c, dc, result, cl.info)
 
 proc eraseVoidParams*(t: PType) =
+  # transform '(): void' into '()' because old parts of the compiler really
+  # don't deal with '(): void':
   if t.sons[0] != nil and t.sons[0].kind == tyEmpty:
     t.sons[0] = nil