system.fields|fieldPairs for objects
This commit is contained in:
parent
8e9b39084c
commit
d15981adbc
5 changed files with 170 additions and 37 deletions
|
|
@ -938,7 +938,8 @@ proc matchTypeClass*(bindings: var TIdTable, typeClass, t: PType): bool =
|
|||
of tyTypeClass:
|
||||
match = matchTypeClass(bindings, req, t)
|
||||
else: nil
|
||||
elif t.kind in {tyObject}:
|
||||
elif t.kind in {tyObject} and req.len != 0:
|
||||
# empty 'object' is fine as constraint in a type class
|
||||
match = sameType(t, req)
|
||||
|
||||
if tfAny in typeClass.flags:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue