From 1d44fee399868ebc6c5e412ee23c7fd1e4c37351 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 3 Jun 2016 23:06:59 +0200 Subject: [PATCH] hotfix: don't crash for wrong template calls --- compiler/evaltempl.nim | 2 +- compiler/sigmatch.nim | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/evaltempl.nim b/compiler/evaltempl.nim index e136265da..96ede44fd 100644 --- a/compiler/evaltempl.nim +++ b/compiler/evaltempl.nim @@ -79,7 +79,7 @@ proc evalTemplateArgs(n: PNode, s: PSym; fromHlo: bool): PNode = else: s.ast[genericParamsPos].len expectedRegularParams = expectedRegularParams + genericParams: globalError(n.info, errWrongNumberOfArguments) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index e72db45e7..df27e3c1d 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -256,6 +256,7 @@ proc describeArgs*(c: PContext, n: PNode, startIdx = 1; add(result, renderTree(n.sons[i].sons[0])) add(result, ": ") if arg.typ.isNil and arg.kind notin {nkStmtList, nkDo}: + # XXX we really need to 'tryExpr' here! arg = c.semOperand(c, n.sons[i].sons[1]) n.sons[i].typ = arg.typ n.sons[i].sons[1] = arg