diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 0c185b09ab..029bf6c8c6 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -229,15 +229,13 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = rawAddSon(result, newbody) checkPartialConstructedType(cl.info, newbody) -proc normalizeProcType(t: PType) = +proc eraseVoidParams(t: PType) = if t.sons[0] != nil and t.sons[0].kind == tyEmpty: t.sons[0] = nil for i in 1 .. 0: t.n.sons[i].sym.typ = skipped + proc propagateFieldFlags(t: PType, n: PNode) = # This is meant for objects and tuples # The type must be fully instantiated! @@ -320,7 +327,8 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = of tyObject, tyTuple: propagateFieldFlags(result, result.n) of tyProc: - normalizeProcType(result) + eraseVoidParams(result) + skipIntLiteralParams(result) else: discard proc generateTypeInstance*(p: PContext, pt: TIdTable, info: TLineInfo,