This commit is contained in:
Andreas Rumpf 2016-08-02 14:53:21 +02:00
commit 4d5c0027e6
2 changed files with 25 additions and 0 deletions

View file

@ -1031,6 +1031,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
if x < isSubtype: return isNone
# 'and' implies minimum matching result:
if x < result: result = x
if result > isGeneric: result = isGeneric
bindingRet result
of tyOr:
@ -1041,6 +1042,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
# 'or' implies maximum matching result:
if x > result: result = x
if result >= isSubtype:
if result > isGeneric: result = isGeneric
bindingRet result
else:
result = isNone