Skip to content

Commit 0377152

Browse files
authored
fix #18327 (#18328)
1 parent d8488e4 commit 0377152

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/semtypes.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
12951295
let param = strTableGet(c.signatures, arg.name)
12961296
if param != nil: typ = param.typ
12971297
else:
1298-
localError(c.config, a.info, "parameter '$1' requires a type" % param.name.s)
1298+
localError(c.config, a.info, "parameter '$1' requires a type" % arg.name.s)
12991299
typ = errorType(c)
13001300
let lifted = liftParamType(c, kind, genericParams, typ,
13011301
arg.name.s, arg.info)

tests/errmsgs/t18327.nim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
discard """
2+
errormsg: "parameter 'n' requires a type"
3+
"""
4+
5+
proc fn3(n) = discard

0 commit comments

Comments
 (0)