diff options
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r-- | compiler/sigmatch.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 9e99353d1..b4d875981 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -587,8 +587,14 @@ proc recordRel(c: var TCandidate, f, a: PType, flags: TTypeRelFlags): TTypeRelat let firstField = if f.kind == tyTuple: 0 else: 1 for _, ff, aa in tupleTypePairs(f, a): + let oldInheritancePenalty = c.inheritancePenalty var m = typeRel(c, ff, aa, flags) if m < isSubtype: return isNone + if m == isSubtype and c.inheritancePenalty > oldInheritancePenalty: + # we can't process individual element type conversions from a + # type conversion for the whole tuple + # subtype relations need type conversions when inheritance is used + return isNone result = minRel(result, m) if f.n != nil and a.n != nil: for i in 0..<f.n.len: |