diff options
Diffstat (limited to 'tests/exprs/texprstmt.nim')
-rw-r--r-- | tests/exprs/texprstmt.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/exprs/texprstmt.nim b/tests/exprs/texprstmt.nim new file mode 100644 index 000000000..3c9704650 --- /dev/null +++ b/tests/exprs/texprstmt.nim @@ -0,0 +1,12 @@ +discard """ + errormsg: "expression 'result[1 .. BackwardsIndex(1)]' is of type 'string' and has to be used (or discarded)" + line: 10 +""" + +# bug #578 + +proc test: string = + result = "blah" + result[1 .. ^1] + +echo test() |