summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/tforward_decl_only.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ccgbugs/tforward_decl_only.nim b/tests/ccgbugs/tforward_decl_only.nim
index dcd74eaf4..f4e9c216e 100644
--- a/tests/ccgbugs/tforward_decl_only.nim
+++ b/tests/ccgbugs/tforward_decl_only.nim
@@ -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)