diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-04-18 20:53:57 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-04-18 20:53:57 +0200 |
commit | a55817f9ac0bde9e6bf6ee2f39ff38334f7e0a35 (patch) | |
tree | 35fd2f81209523fa075c87c1f9b8fe4719f61bf7 /compiler | |
parent | ed6160ad6d3019e86ba49dca00640fb8946ad69c (diff) | |
download | Nim-a55817f9ac0bde9e6bf6ee2f39ff38334f7e0a35.tar.gz |
Fix varargs int32 (#11054)
* fixes #10999 * adds a test for #10999
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/sigmatch.nim | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 7083b052f..194055da9 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -2092,14 +2092,21 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType, result = localConvMatch(c, m, f, a, arg) else: r = typeRel(m, base(f), a) - if r >= isGeneric: + case r + of isGeneric: inc(m.convMatches) result = copyTree(arg) - if r == isGeneric: - result.typ = getInstantiatedType(c, arg, m, base(f)) + result.typ = getInstantiatedType(c, arg, m, base(f)) m.baseTypeMatch = true - # bug #4799, varargs accepting subtype relation object - elif r == isSubtype: + of isFromIntLit: + inc(m.intConvMatches, 256) + result = implicitConv(nkHiddenStdConv, f[0], arg, m, c) + m.baseTypeMatch = true + of isEqual: + inc(m.convMatches) + result = copyTree(arg) + m.baseTypeMatch = true + of isSubtype: # bug #4799, varargs accepting subtype relation object inc(m.subtypeMatches) if base(f).kind == tyTypeDesc: result = arg |