Bugfix: The compiler were not inserting proper downcasts for generic types
This resulted in a codegen error in C++ mode, because the generic types were not defined in modules where calls requiring downcasts were used (generating a downcast forces the inclusion of the full definition of the involved types).
This commit is contained in:
parent
4ab1cfb0b0
commit
7297613900
4 changed files with 25 additions and 4 deletions
|
|
@ -1962,7 +1962,8 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
|
|||
inc(m.genericMatches)
|
||||
if arg.typ == nil:
|
||||
result = arg
|
||||
elif skipTypes(arg.typ, abstractVar-{tyTypeDesc}).kind == tyTuple:
|
||||
elif skipTypes(arg.typ, abstractVar-{tyTypeDesc}).kind == tyTuple or
|
||||
m.inheritancePenalty > 0:
|
||||
result = implicitConv(nkHiddenSubConv, f, arg, m, c)
|
||||
elif arg.typ.isEmptyContainer:
|
||||
result = arg.copyTree
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue