summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2018-03-20 10:14:47 +0000
committerAndreas Rumpf <rumpf_a@web.de>2018-03-20 11:14:47 +0100
commit23230572e2ea4b6ed9e56ef4e68124cbaf3041c1 (patch)
tree55f294aa750c1e1bd2212959e3aad2d61586bc41 /tests/ccgbugs
parenta581118d0e5d809bb966b4dbe669ac9bd974638e (diff)
downloadNim-23230572e2ea4b6ed9e56ef4e68124cbaf3041c1.tar.gz
Fixes #7363 (#7371)
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)