make tests green
This commit is contained in:
parent
eb03d9aafe
commit
21cbf438ce
1 changed files with 6 additions and 9 deletions
|
|
@ -1,15 +1,11 @@
|
||||||
discard """
|
discard """
|
||||||
file: "tnil.nim"
|
file: "tnil.nim"
|
||||||
output: '''0x1
|
output: '''1
|
||||||
|
0
|
||||||
nil
|
0
|
||||||
|
|
||||||
nil
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
disabled: "windows"
|
|
||||||
"""
|
"""
|
||||||
|
{.experimental: "notnil".}
|
||||||
type
|
type
|
||||||
MyPointer = distinct pointer
|
MyPointer = distinct pointer
|
||||||
MyString = distinct string
|
MyString = distinct string
|
||||||
|
|
@ -17,7 +13,8 @@ type
|
||||||
MyInt = distinct int
|
MyInt = distinct int
|
||||||
|
|
||||||
proc foo(a: MyPointer) =
|
proc foo(a: MyPointer) =
|
||||||
echo a.repr
|
# workaround a Windows 'repr' difference:
|
||||||
|
echo cast[int](a)
|
||||||
|
|
||||||
foo(cast[MyPointer](1))
|
foo(cast[MyPointer](1))
|
||||||
foo(cast[MyPointer](nil))
|
foo(cast[MyPointer](nil))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue