summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-10-14 09:55:47 +0200
committerGitHub <noreply@github.com>2020-10-14 09:55:47 +0200
commitc664fb284349e2d03148890dfec169b844694eae (patch)
tree17780636990ecc140ac66e04593173511e3d2181
parentfc90eb9f27082e36d2ccf3c36757f08bbd5b4ea5 (diff)
downloadNim-c664fb284349e2d03148890dfec169b844694eae.tar.gz
sigmatch: hotfix [backport] (#15565)
-rw-r--r--compiler/sigmatch.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 1441203e8..687634e93 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1107,7 +1107,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
@@ -1441,7 +1441,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