parent
e8a00b805f
commit
953b8cbcc2
2 changed files with 52 additions and 7 deletions
|
|
@ -3,6 +3,8 @@ discard """
|
|||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
true'''
|
||||
"""
|
||||
|
||||
|
|
@ -64,6 +66,27 @@ block:
|
|||
result = result and obj2.`&&`.isNil()
|
||||
echo test()
|
||||
|
||||
# Test codegen for fields with uppercase letters:
|
||||
block:
|
||||
type MyObj = object
|
||||
mField: int
|
||||
proc test(): bool =
|
||||
var a: MyObj
|
||||
var b = a
|
||||
result = b.mField == 0
|
||||
echo test()
|
||||
|
||||
# Test tuples
|
||||
block:
|
||||
type T = tuple
|
||||
a: int
|
||||
b: int
|
||||
proc test(): bool =
|
||||
var a: T = (a: 1, b: 1)
|
||||
result = a.a == 1
|
||||
result = result and a.b == 1
|
||||
echo test()
|
||||
|
||||
# Test importc / exportc fields:
|
||||
block:
|
||||
type T = object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue