diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index e6e0b7fe48..2831d58539 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1086,7 +1086,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, let x = typeRel(c, f, branch, flags + {trDontBind}) if x == isNone: return isNone if x < result: result = x - return + return result of tyAnd: # XXX: deal with the current dual meaning of tyGenericParam @@ -1421,7 +1421,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, let ff = rootf[i] let aa = roota[i] let res = typeRel(c, ff, aa, nextFlags) - if res != isEqual: result = isGeneric + if res != isNone and res != isEqual: result = isGeneric if res notin {isEqual, isGeneric}: if trNoCovariance notin flags and ff.kind == aa.kind: let paramFlags = rootf.base[i-1].flags