summary refs log tree commit diff stats
path: root/tests/objects/t3734.nim
diff options
context:
space:
mode:
authorNeelesh Chandola <neelesh.chandola@outlook.com>2019-01-10 17:19:35 +0530
committerAndreas Rumpf <rumpf_a@web.de>2019-01-10 12:49:35 +0100
commitd998cb58dd9a29cb7b739ee4daa6a0528810790d (patch)
tree7d18418f23f1ef1c57dd69bea778226664fa9e49 /tests/objects/t3734.nim
parent6389271d1cef23e2f810736a4fb0c06d0164d984 (diff)
downloadNim-d998cb58dd9a29cb7b739ee4daa6a0528810790d.tar.gz
void object fields are now ignored by codegen and fields/fieldPairs iterator (#10144)
* Codegen now ignores object fields of type void
* Fix `$` bug for objects/tuples where it does not add a comma
* fields/fieldPairs iterators now ignore void types
* Use `isEmptyType` instead of checking for `tyVoid` directly
Diffstat (limited to 'tests/objects/t3734.nim')
-rw-r--r--tests/objects/t3734.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/objects/t3734.nim b/tests/objects/t3734.nim
new file mode 100644
index 000000000..cebef6081
--- /dev/null
+++ b/tests/objects/t3734.nim
@@ -0,0 +1,17 @@
+discard """
+output: "i0"
+"""
+
+type
+  Application = object
+      config: void
+      i: int
+      f: void
+
+proc printFields(rec: Application) =
+  for k, v in fieldPairs(rec):
+    echo k, v
+
+var app: Application
+
+printFields(app)