summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-08-02 14:53:21 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-08-02 14:53:21 +0200
commit4d5c0027e6d9e7a70c79cd441043357fb270bff0 (patch)
tree6f81648301376f6c56b8cac2bcee3d5483ffa64a /compiler
parentde6198c747afc32a9bd41b70eb9d217054a916f0 (diff)
downloadNim-4d5c0027e6d9e7a70c79cd441043357fb270bff0.tar.gz
fixes #4537
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sigmatch.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index df094402c..95f5f0b07 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1031,6 +1031,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
         if x < isSubtype: return isNone
         # 'and' implies minimum matching result:
         if x < result: result = x
+      if result > isGeneric: result = isGeneric
       bindingRet result
 
   of tyOr:
@@ -1041,6 +1042,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
         # 'or' implies maximum matching result:
         if x > result: result = x
       if result >= isSubtype:
+        if result > isGeneric: result = isGeneric
         bindingRet result
       else:
         result = isNone