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

View file

@ -2700,6 +2700,7 @@ proc `$`*[T: tuple|object](x: T): string =
firstElement = false
else:
result.add("...")
firstElement = false
when not isNamed:
if count == 1:
result.add(",") # $(1,) should print as the semantically legal (1,)