This commit is contained in:
Michael Jendrusch 2017-01-20 05:16:42 +01:00 • committed by Andreas Rumpf
commit 953b8cbcc2
2 changed files with 52 additions and 7 deletions

View file

@ -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