expand the test case for bug 1049
This commit is contained in:
parent
5b32fb1791
commit
aa69a8a09f
2 changed files with 11 additions and 3 deletions
|
|
@ -225,11 +225,10 @@ proc semArrayIndex(c: PContext, n: PNode): PType =
|
|||
elif e.kind == nkSym and e.typ.kind == tyStatic:
|
||||
if e.sym.ast != nil:
|
||||
return semArrayIndex(c, e.sym.ast)
|
||||
internalAssert c.inGenericContext > 0
|
||||
if not isOrdinalType(e.typ.lastSon):
|
||||
localError(n[1].info, errOrdinalTypeExpected)
|
||||
result = makeRangeWithStaticExpr(c, e)
|
||||
result.flags.incl tfUnresolved
|
||||
if c.inGenericContext >0: result.flags.incl tfUnresolved
|
||||
elif e.kind in nkCallKinds and hasGenericArguments(e):
|
||||
if not isOrdinalType(e.typ):
|
||||
localError(n[1].info, errOrdinalTypeExpected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue