parent
ed6160ad6d
commit
a55817f9ac
2 changed files with 22 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue