summary refs log tree commit diff stats
path: root/tests/system/tensuremove1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/system/tensuremove1.nim')
-rw-r--r--tests/system/tensuremove1.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/system/tensuremove1.nim b/tests/system/tensuremove1.nim
new file mode 100644
index 000000000..b7e19c4fb
--- /dev/null
+++ b/tests/system/tensuremove1.nim
@@ -0,0 +1,16 @@
+discard """
+  errormsg: "cannot move 's', which introduces an implicit copy"
+  matrix: "--cursorinference:on; --cursorinference:off"
+"""
+
+type
+  String = object
+    id: string
+
+proc hello =
+  var s = String(id: "1")
+  var m = ensureMove s
+  discard m
+  discard s
+
+hello()
\ No newline at end of file