summary refs log tree commit diff stats
path: root/compiler/sigmatch.nim
diff options
context:
space:
mode:
authorAnatoly Galiulin <galiulin.anatoly@gmail.com>2016-06-24 15:22:22 +0600
committerAnatoly Galiulin <galiulin.anatoly@gmail.com>2016-06-24 15:22:22 +0600
commit75cca15c6513da5ef8da1117160e882b0f0f1c1b (patch)
treee615655f71da282c2663cf6dc09939b4c5747b27 /compiler/sigmatch.nim
parent764668d099a67ef6b877d07e4857c92d5774fe98 (diff)
downloadNim-75cca15c6513da5ef8da1117160e882b0f0f1c1b.tar.gz
Speedup generic relations detection
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r--compiler/sigmatch.nim2
1 files changed, 1 insertions, 1 deletions
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:
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233