hotfix: don't crash for wrong template calls
This commit is contained in:
parent
4e72e71284
commit
1d44fee399
2 changed files with 2 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue