fixes #3338
This commit is contained in:
parent
3f24a7ff3e
commit
d93507fd2e
4 changed files with 51 additions and 4 deletions
|
|
@ -239,14 +239,20 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
|
|||
pushInfoContext(info)
|
||||
var entry = TInstantiation.new
|
||||
entry.sym = result
|
||||
newSeq(entry.concreteTypes, gp.len)
|
||||
# we need to compare both the generic types and the concrete types:
|
||||
# generic[void](), generic[int]()
|
||||
# see ttypeor.nim test.
|
||||
var i = 0
|
||||
newSeq(entry.concreteTypes, fn.typ.len+gp.len)
|
||||
for s in instantiateGenericParamList(c, gp, pt):
|
||||
addDecl(c, s)
|
||||
entry.concreteTypes[i] = s.typ
|
||||
inc i
|
||||
pushProcCon(c, result)
|
||||
instantiateProcType(c, pt, result, info)
|
||||
for j in 0 .. result.typ.len-1:
|
||||
entry.concreteTypes[i] = result.typ.sons[j]
|
||||
inc i
|
||||
if tfTriggersCompileTime in result.typ.flags:
|
||||
incl(result.flags, sfCompileTime)
|
||||
n.sons[genericParamsPos] = ast.emptyNode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue