diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-05-05 14:17:31 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-05-05 14:17:31 +0200 |
commit | 805402b294c6cb3ee8e0f39245aa2d1366ae76e9 (patch) | |
tree | 6a8b4f95a81904e1b5e97b6ea79288fbc9e7130e /tests/parser | |
parent | 21cbf438ceae059f528cfd28bbeec5b637e210ac (diff) | |
download | Nim-805402b294c6cb3ee8e0f39245aa2d1366ae76e9.tar.gz |
fixes #7582
Diffstat (limited to 'tests/parser')
-rw-r--r-- | tests/parser/tcommand_as_expr.nim | 13 | ||||
-rw-r--r-- | tests/parser/twrongcmdsyntax.nim | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/parser/tcommand_as_expr.nim b/tests/parser/tcommand_as_expr.nim index a244c8767..b25ec4bd8 100644 --- a/tests/parser/tcommand_as_expr.nim +++ b/tests/parser/tcommand_as_expr.nim @@ -2,7 +2,10 @@ discard """ output: '''140 5-120-120 359 -77''' +77 +-4 +-1 +-1''' """ #import math import sequtils @@ -25,3 +28,11 @@ let a = [2,4,8].map do (d:int) -> int: d + 1 echo a[0], a[1], a[2] echo(foo 8, foo 8) + +# bug #7582 +proc f(x: int): int = x + +echo f -4 + +echo int -1 # doesn't compile +echo int `-` 1 # compiles diff --git a/tests/parser/twrongcmdsyntax.nim b/tests/parser/twrongcmdsyntax.nim index affe72c34..c2962bed4 100644 --- a/tests/parser/twrongcmdsyntax.nim +++ b/tests/parser/twrongcmdsyntax.nim @@ -1,5 +1,5 @@ discard """ - errormsg: '''identifier expected, but found 'echo 4''' + errormsg: '''in expression '4 2': identifier expected, but found '4''' line: 6 """ |