summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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