diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-09-16 11:39:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-16 11:39:27 +0200 |
commit | 501f6c80203c9dd8ca1bdf759f8850fb216e7755 (patch) | |
tree | f45e3d07b3de265e80049a2f1ec7e1dc78583708 /tests | |
parent | 83419c8cfbcdca0c582260ad4656f4b60d50117f (diff) | |
parent | 9fc0a9ad420876ba9548aa56d4120d6b9bd3a282 (diff) | |
download | Nim-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.nim | 19 |
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 |