This commit is contained in:
cooldome 2018-03-20 10:14:47 +00:00 • committed by Andreas Rumpf
commit 23230572e2
2 changed files with 17 additions and 2 deletions

View file

@ -13,3 +13,17 @@ type AnotherType = object
let x = AnotherType(f: newMyRefObject("hello"))
echo $x.f
# bug #7363
type
Foo = object
a: cint
Foo2 = object
b: cint
proc f(foo: ptr Foo, foo2: ptr Foo2): cint =
if foo != nil: {.emit: "`result` = `foo`->a;".}
if foo2 != nil: {.emit: [result, " = ", foo2[], ".b;"].}
discard f(nil, nil)