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:
parent
6389271d1c
commit
d998cb58dd
5 changed files with 25 additions and 0 deletions
17
tests/objects/t3734.nim
Normal file
17
tests/objects/t3734.nim
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue