This commit is contained in:
Andreas Rumpf
2016-07-19 20:19:52 +02:00
parent 6905a6fae3
commit d4573f1762
2 changed files with 20 additions and 1 deletions

View File

@@ -1451,7 +1451,7 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType,
if skipTypes(f, abstractVar-{tyTypeDesc}).kind in {tyTuple}:
result = implicitConv(nkHiddenSubConv, f, arg, m, c)
of isNone:
# do not do this in ``typeRel`` as it then can't infere T in ``ref T``:
# do not do this in ``typeRel`` as it then can't infer T in ``ref T``:
if a.kind in {tyProxy, tyUnknown}:
inc(m.genericMatches)
m.fauxMatch = a.kind
@@ -1472,6 +1472,7 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType,
m.baseTypeMatch = true
else:
result = userConvMatch(c, m, base(f), a, arg)
if result != nil: m.baseTypeMatch = true
proc paramTypesMatch*(m: var TCandidate, f, a: PType,
arg, argOrig: PNode): PNode =

View File

@@ -0,0 +1,18 @@
# bug #888
type
PyRef = object
PPyRef* = ref PyRef
converter to_py*(i: int) : PPyRef = nil
when false:
proc to_tuple*(vals: openarray[PPyRef]): PPyRef =
discard
proc abc(args: varargs[PPyRef]) =
#let args_tup = to_tuple(args)
discard
abc(1, 2)