first phase of tyGenericParam reforms needed for static params
This commit is contained in:
parent
4d2c948281
commit
37b199d34a
6 changed files with 79 additions and 47 deletions
|
|
@ -394,21 +394,11 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType =
|
|||
propagateToOwner(result, result.sons[i])
|
||||
|
||||
result.n = replaceTypeVarsN(cl, result.n)
|
||||
|
||||
# XXX: This is not really needed?
|
||||
# if result.kind in GenericTypes:
|
||||
# localError(cl.info, errCannotInstantiateX, typeToString(t, preferName))
|
||||
|
||||
|
||||
case result.kind
|
||||
of tyArray:
|
||||
let idx = result.sons[0]
|
||||
if idx.kind == tyStatic:
|
||||
if idx.n == nil:
|
||||
let lookup = lookupTypeVar(cl, idx)
|
||||
internalAssert lookup != nil
|
||||
idx.n = lookup.n
|
||||
|
||||
result.sons[0] = makeRangeType(cl.c, 0, idx.n.intVal - 1, idx.n.info)
|
||||
internalAssert idx.kind != tyStatic
|
||||
|
||||
of tyObject, tyTuple:
|
||||
propagateFieldFlags(result, result.n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue