disabled non-documented overloading rule for templates and macros
This commit is contained in:
parent
bd1dfa4b38
commit
1b22a3b346
3 changed files with 21 additions and 14 deletions
|
|
@ -1859,19 +1859,22 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
|
|||
|
||||
var r = typeRel(m, f, a)
|
||||
|
||||
if r != isNone and m.calleeSym != nil and
|
||||
m.calleeSym.kind in {skMacro, skTemplate}:
|
||||
# XXX: duplicating this is ugly, but we cannot (!) move this
|
||||
# directly into typeRel using return-like templates
|
||||
incMatches(m, r)
|
||||
if f.kind == tyStmt:
|
||||
return arg
|
||||
elif f.kind == tyTypeDesc:
|
||||
return arg
|
||||
elif f.kind == tyStatic:
|
||||
return arg.typ.n
|
||||
else:
|
||||
return argSemantized # argOrig
|
||||
when false:
|
||||
# This special typing rule for macros and templates is not documented
|
||||
# anywhere and breaks symmetry.
|
||||
if r != isNone and m.calleeSym != nil and
|
||||
m.calleeSym.kind in {skMacro, skTemplate}:
|
||||
# XXX: duplicating this is ugly, but we cannot (!) move this
|
||||
# directly into typeRel using return-like templates
|
||||
incMatches(m, r)
|
||||
if f.kind == tyStmt:
|
||||
return arg
|
||||
elif f.kind == tyTypeDesc:
|
||||
return arg
|
||||
elif f.kind == tyStatic:
|
||||
return arg.typ.n
|
||||
else:
|
||||
return argSemantized # argOrig
|
||||
|
||||
# If r == isBothMetaConvertible then we rerun typeRel.
|
||||
# bothMetaCounter is for safety to avoid any infinite loop,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue