summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-29 15:46:50 +0200
committerAraq <rumpf_a@web.de>2018-08-30 15:49:51 +0200
commite98e21442253c8f376e2b48753ed036dbd99aa9f (patch)
treeea74024e531c3e77378d5b63471dc3cee09438b5 /compiler
parent8e336672623c1b36baf2b89117cc62516ac61c30 (diff)
downloadNim-e98e21442253c8f376e2b48753ed036dbd99aa9f.tar.gz
fixes #7854
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sigmatch.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 932163055..c53c73074 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1921,6 +1921,7 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
             result.typ.n = arg
             return
 
+  let oldInheritancePenalty = m.inheritancePenalty
   var r = typeRel(m, f, a)
 
   # This special typing rule for macros and templates is not documented
@@ -2002,7 +2003,7 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
     if arg.typ == nil:
       result = arg
     elif skipTypes(arg.typ, abstractVar-{tyTypeDesc}).kind == tyTuple or
-         m.inheritancePenalty > 0:
+         m.inheritancePenalty > oldInheritancePenalty:
       result = implicitConv(nkHiddenSubConv, f, arg, m, c)
     elif arg.typ.isEmptyContainer:
       result = arg.copyTree