summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2023-03-30 15:35:00 +0200
committerGitHub <noreply@github.com>2023-03-30 15:35:00 +0200
commit72ca444122bf99c58a88768faa22c12aca5e3ccc (patch)
tree3ae81b96e0d2b5113ab04ddb49e1f0804f0bdebd
parentecf9efa3977f95aed5229ab79cd6ac4799a32a4c (diff)
downloadNim-72ca444122bf99c58a88768faa22c12aca5e3ccc.tar.gz
hopefully easier to understand error message (#21585)
-rw-r--r--compiler/semcall.nim4
-rw-r--r--tests/errmsgs/tconcisetypemismatch.nim4
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index 987fd4a13..8445b25e7 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -132,7 +132,7 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode,
       # just in case, should be impossible though
       if syms.len == 0:
         break
-    
+
     if nextSymIndex > high(syms):
       # we have reached the end
       break
@@ -293,7 +293,7 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
 const
   errTypeMismatch = "type mismatch: got <"
   errButExpected = "but expected one of:"
-  errExpectedPosition = "Expected one of (first mismatch at position [#]):"
+  errExpectedPosition = "Expected one of (first mismatch at [position]):"
   errUndeclaredField = "undeclared field: '$1'"
   errUndeclaredRoutine = "attempting to call undeclared routine: '$1'"
   errBadRoutine = "attempting to call routine: '$1'$2"
diff --git a/tests/errmsgs/tconcisetypemismatch.nim b/tests/errmsgs/tconcisetypemismatch.nim
index 4227644ce..c2896604f 100644
--- a/tests/errmsgs/tconcisetypemismatch.nim
+++ b/tests/errmsgs/tconcisetypemismatch.nim
@@ -7,7 +7,7 @@ Expression: int(inNanoseconds(t2 - t1)) / 100.5
   [1] int(inNanoseconds(t2 - t1)): int
   [2] 100.5: float64
 
-Expected one of (first mismatch at position [#]):
+Expected one of (first mismatch at [position]):
 [1] proc `/`(x, y: float): float
 [1] proc `/`(x, y: float32): float32
 [2] proc `/`(x, y: int): float
@@ -20,4 +20,4 @@ from times import inNanoseconds
 let t1 = getMonotime()
 let result = 1 + 2
 let t2 = getMonotime()
-echo "Elapsed: ", (t2 - t1).inNanoseconds.int / 100.5
\ No newline at end of file
+echo "Elapsed: ", (t2 - t1).inNanoseconds.int / 100.5