From 723efe7cfb6cb6ea4147cb5ba407ad3f39ac9032 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 29 Dec 2013 19:26:52 +0200 Subject: [PATCH] fix the filtering of void params in procs' signatures --- compiler/semtypinst.nim | 24 ++++++++++++++++++++---- tests/reject/mbind4.nim | 9 --------- tests/reject/tactiontable2.nim | 14 +++++++------- tests/reject/tbind4.nim | 13 ------------- tests/reject/teffects1.nim | 2 +- 5 files changed, 28 insertions(+), 34 deletions(-) delete mode 100644 tests/reject/mbind4.nim delete mode 100644 tests/reject/tbind4.nim diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 0bb27946f1..04d2577075 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -189,14 +189,32 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = newbody.flags = newbody.flags + t.flags + body.flags result.flags = result.flags + newbody.flags newbody.callConv = body.callConv - newbody.n = replaceTypeVarsN(cl, lastSon(body).n) # 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 if newbody.isGenericAlias: newbody = newbody.skipGenericAlias rawAddSon(result, newbody) checkPartialConstructedType(cl.info, newbody) + +proc normalizeProcType(t: PType) = + if t.sons[0] != nil and t.sons[0].kind == tyEmpty: + t.sons[0] = nil + for i in 1 ..