Test case for #7010
This commit is contained in:
parent
7af659cf59
commit
4e305c3040
1 changed files with 19 additions and 0 deletions
19
tests/distinct/t7010.nim
Normal file
19
tests/distinct/t7010.nim
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue