mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-09 22:43:34 +00:00
Fixes #710.
This commit is contained in:
@@ -81,6 +81,8 @@ proc notFoundError*(c: PContext, n: PNode, errors: seq[string]) =
|
||||
if c.inCompilesContext > 0:
|
||||
# fail fast:
|
||||
globalError(n.info, errTypeMismatch, "")
|
||||
if errors.len == 0:
|
||||
localError(n.info, errExprXCannotBeCalled, n[0].renderTree)
|
||||
var result = msgKindToString(errTypeMismatch)
|
||||
add(result, describeArgs(c, n, 1))
|
||||
add(result, ')')
|
||||
|
||||
10
tests/misc/tissue710.nim
Normal file
10
tests/misc/tissue710.nim
Normal file
@@ -0,0 +1,10 @@
|
||||
discard """
|
||||
file: "tissue710.nim"
|
||||
line: 8
|
||||
errorMsg: "expression '||' cannot be called"
|
||||
"""
|
||||
var sum = 0
|
||||
for x in 3..1000:
|
||||
if (x mod 3 == 0) || (x mod 5 == 0):
|
||||
sum += x
|
||||
echo(sum)
|
||||
Reference in New Issue
Block a user