support derived values in non-generic user type classes
This commit is contained in:
parent
77a4512ae8
commit
0b0a3e5f20
7 changed files with 59 additions and 47 deletions
|
|
@ -1197,22 +1197,14 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
|
|||
else:
|
||||
return isNone
|
||||
|
||||
of tyUserTypeClass:
|
||||
considerPreviousT:
|
||||
of tyUserTypeClassInst, tyUserTypeClass:
|
||||
if f.isResolvedUserTypeClass:
|
||||
result = typeRel(c, f.lastSon, a)
|
||||
else:
|
||||
var matched = matchUserTypeClass(c.c, c, f, aOrig)
|
||||
if matched != nil:
|
||||
# TODO, make user type classes skipable too
|
||||
put(c, f, a)
|
||||
result = isGeneric
|
||||
else:
|
||||
result = isNone
|
||||
|
||||
of tyUserTypeClassInst:
|
||||
considerPreviousT:
|
||||
var matched = matchUserTypeClass(c.c, c, f, aOrig)
|
||||
if matched != nil:
|
||||
matched.sons.add a
|
||||
put(c.bindings, f, matched)
|
||||
bindConcreteTypeToUserTypeClass(matched, a)
|
||||
put(c, f, matched)
|
||||
result = isGeneric
|
||||
else:
|
||||
result = isNone
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue