summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-06-22 18:44:56 +0800
committerGitHub <noreply@github.com>2021-06-22 12:44:56 +0200
commit037715285c088af46c94939f36abef63c95406e8 (patch)
treeb877135b59211340860f529aa253ca875989d64d
parentd8488e41e85c84a6b5fe687940b7fee10314d1f1 (diff)
downloadNim-037715285c088af46c94939f36abef63c95406e8.tar.gz
fix #18327 (#18328)
-rw-r--r--compiler/semtypes.nim2
-rw-r--r--tests/errmsgs/t18327.nim5
2 files changed, 6 insertions, 1 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 38307a9ac..484997e3a 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1295,7 +1295,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
         let param = strTableGet(c.signatures, arg.name)
         if param != nil: typ = param.typ
         else:
-          localError(c.config, a.info, "parameter '$1' requires a type" % param.name.s)
+          localError(c.config, a.info, "parameter '$1' requires a type" % arg.name.s)
           typ = errorType(c)
       let lifted = liftParamType(c, kind, genericParams, typ,
                                  arg.name.s, arg.info)
diff --git a/tests/errmsgs/t18327.nim b/tests/errmsgs/t18327.nim
new file mode 100644
index 000000000..686a1bd0c
--- /dev/null
+++ b/tests/errmsgs/t18327.nim
@@ -0,0 +1,5 @@
+discard """
+  errormsg: "parameter 'n' requires a type"
+"""
+
+proc fn3(n) = discard
\ No newline at end of file