Nim/tests/distinct/t7010.nim
Ganesh Viswanathan 4e305c3040 Test case for #7010
2018-09-14 14:07:31 -05:00

19 lines
No EOL
355 B
Nim

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