bugfix: in some contexts, newSeq[T](n) is incorrectly inferred to have a seq[typedesc[T]] type
This commit is contained in:
parent
86108be24b
commit
e2594f44bd
1 changed files with 4 additions and 2 deletions
|
|
@ -93,8 +93,10 @@ proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PSym,
|
||||||
var typeParams = callee.ast[genericParamsPos]
|
var typeParams = callee.ast[genericParamsPos]
|
||||||
for i in 1..min(sonsLen(typeParams), sonsLen(binding)-1):
|
for i in 1..min(sonsLen(typeParams), sonsLen(binding)-1):
|
||||||
var formalTypeParam = typeParams.sons[i-1].typ
|
var formalTypeParam = typeParams.sons[i-1].typ
|
||||||
#debug(formalTypeParam)
|
var bound = binding[i].typ
|
||||||
put(c.bindings, formalTypeParam, binding[i].typ)
|
if formalTypeParam.kind != tyTypeDesc:
|
||||||
|
bound = bound.skipTypes({tyTypeDesc})
|
||||||
|
put(c.bindings, formalTypeParam, bound)
|
||||||
|
|
||||||
proc newCandidate*(ctx: PContext, callee: PSym,
|
proc newCandidate*(ctx: PContext, callee: PSym,
|
||||||
binding: PNode, calleeScope = -1): TCandidate =
|
binding: PNode, calleeScope = -1): TCandidate =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue