summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-09-16 11:39:27 +0200
committerGitHub <noreply@github.com>2018-09-16 11:39:27 +0200
commit501f6c80203c9dd8ca1bdf759f8850fb216e7755 (patch)
treef45e3d07b3de265e80049a2f1ec7e1dc78583708 /tests
parent83419c8cfbcdca0c582260ad4656f4b60d50117f (diff)
parent9fc0a9ad420876ba9548aa56d4120d6b9bd3a282 (diff)
downloadNim-501f6c80203c9dd8ca1bdf759f8850fb216e7755.tar.gz
Merge pull request #8970 from genotrance/test-7010
Test case for #7010
Diffstat (limited to 'tests')
-rw-r--r--tests/distinct/t7010.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/distinct/t7010.nim b/tests/distinct/t7010.nim
new file mode 100644
index 000000000..0cae002be
--- /dev/null
+++ b/tests/distinct/t7010.nim
@@ -0,0 +1,19 @@
+discard """
+  exitcode: 0
+  output: ''''''
+"""
+
+# Snippet not defined as ```nim
+
+type MyInt* = distinct int
+
+proc `+`*(x: MyInt, y: MyInt): MyInt {.borrow.}
+proc `+=`*(x: var MyInt, y: MyInt) {.borrow.}
+proc `=`*(x: var MyInt, y: MyInt) {.borrow.}
+
+var next: MyInt
+
+proc getNext*() : MyInt =
+    result = next
+    next += 1.MyInt
+    next = next + 1.MyInt
\ No newline at end of file