hotfix: don't crash for wrong template calls

This commit is contained in:
Andreas Rumpf 2016-06-03 23:06:59 +02:00
commit 1d44fee399
2 changed files with 2 additions and 1 deletions

View file

@ -79,7 +79,7 @@ proc evalTemplateArgs(n: PNode, s: PSym; fromHlo: bool): PNode =
else: s.ast[genericParamsPos].len
expectedRegularParams = <s.typ.len
givenRegularParams = totalParams - genericParams
if givenRegularParams < 0: givenRegularParams = 0
if totalParams > expectedRegularParams + genericParams:
globalError(n.info, errWrongNumberOfArguments)