* fix #13902 distinct uint64 type corruption on 32-bit with borrow Co-authored-by: Timothee Cour <timothee.cour2+lightsail@gmail.com>
This commit is contained in:
parent
3036ec9c44
commit
95fd8ae93c
2 changed files with 13 additions and 1 deletions
12
tests/ccgbugs/t13902.nim
Normal file
12
tests/ccgbugs/t13902.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
#issue #13902
|
||||
block:
|
||||
type Slot = distinct uint64
|
||||
var s = Slot(1)
|
||||
proc `$`(x: Slot): string {.borrow.}
|
||||
proc `+=`(x: var Slot, y: uint64) {.borrow.}
|
||||
# test was failing with either 0 or 2 echos but not with 1 echo
|
||||
# echo "s = ", s
|
||||
s += 1
|
||||
# echo "s = ", s
|
||||
doAssert s.uint64 == 2, $s # was failing, showing 18419607611339964418
|
||||
Loading…
Add table
Add a link
Reference in a new issue