From bef7f726369d845dfbb376ee3531c028bef62498 Mon Sep 17 00:00:00 2001 From: Anatoly Galiulin Date: Mon, 27 Jun 2016 09:16:19 +0600 Subject: [PATCH] Accumulate penalties --- compiler/sigmatch.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index ed5dd6ca13..70fbe73580 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -976,7 +976,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = if x.sons[i].kind == tyGenericParam: internalError("wrong instantiated type!") elif typeRel(c, f.sons[i], x.sons[i]) <= isSubtype: return - c.inheritancePenalty = depth + c.inheritancePenalty += depth result = isGeneric else: let genericBody = f.sons[0]