* fix #19149 Invalid codegen when returning var tuple from a template * fix type
This commit is contained in:
parent
fdc8dd4128
commit
bae0fb720a
2 changed files with 22 additions and 2 deletions
|
|
@ -1905,7 +1905,7 @@ proc implicitConv(kind: TNodeKind, f: PType, arg: PNode, m: TCandidate,
|
|||
else:
|
||||
result.typ = errorType(c)
|
||||
else:
|
||||
result.typ = f.skipTypes({tySink})
|
||||
result.typ = f.skipTypes({tySink, tyVar})
|
||||
if result.typ == nil: internalError(c.graph.config, arg.info, "implicitConv")
|
||||
result.add c.graph.emptyNode
|
||||
result.add arg
|
||||
|
|
@ -2164,7 +2164,8 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
|
|||
of isEqual:
|
||||
inc(m.exactMatches)
|
||||
result = arg
|
||||
if skipTypes(f, abstractVar-{tyTypeDesc}).kind == tyTuple or
|
||||
let ff = skipTypes(f, abstractVar-{tyTypeDesc})
|
||||
if ff.kind == tyTuple or
|
||||
(arg.typ != nil and skipTypes(arg.typ, abstractVar-{tyTypeDesc}).kind == tyTuple):
|
||||
result = implicitConv(nkHiddenSubConv, f, arg, m, c)
|
||||
of isNone:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue