summary refs log tree commit diff stats
path: root/tests/reject/texprstmt.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/reject/texprstmt.nim')
-rw-r--r--tests/reject/texprstmt.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/reject/texprstmt.nim b/tests/reject/texprstmt.nim
new file mode 100644
index 000000000..b32394d8d
--- /dev/null
+++ b/tests/reject/texprstmt.nim
@@ -0,0 +1,12 @@
+discard """
+  line: 10
+  errormsg: "value returned by statement has to be discarded"
+"""
+
+# bug #578
+
+proc test: string =
+  result = "blah"
+  result[1 .. -1]
+
+echo test()