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
This commit is contained in:
Neelesh Chandola 2019-01-10 17:19:35 +05:30 • committed by Andreas Rumpf
commit d998cb58dd
5 changed files with 25 additions and 0 deletions

17
tests/objects/t3734.nim Normal file
View file

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