From 75cca15c6513da5ef8da1117160e882b0f0f1c1b Mon Sep 17 00:00:00 2001 From: Anatoly Galiulin Date: Fri, 24 Jun 2016 15:22:22 +0600 Subject: [PATCH] Speedup generic relations detection --- compiler/sigmatch.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index acbf7d426..ed5dd6ca1 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -970,7 +970,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = # simply no match for now: discard elif x.kind == tyGenericInst and - isGenericSubtype(x, f, depth) and + ((f.sons[0] == x.sons[0]) or isGenericSubtype(x, f, depth)) and (sonsLen(x) - 1 == sonsLen(f)): for i in countup(1, sonsLen(f) - 1): if x.sons[i].kind == tyGenericParam: