Merge pull request #8970 from genotrance/test-7010

Test case for #7010
This commit is contained in:
Andreas Rumpf 2018-09-16 11:39:27 +02:00 • committed by GitHub
commit 501f6c8020
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

19
tests/distinct/t7010.nim Normal file
View file

@ -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