added good error for stuff like string[int] or int[int]
This commit is contained in:
parent
7b3f95d810
commit
51076a0be6
1 changed files with 5 additions and 0 deletions
|
|
@ -885,6 +885,11 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType =
|
|||
for i in countup(1, sonsLen(n)-1):
|
||||
var elem = semGenericParamInInvokation(c, n.sons[i])
|
||||
addToResult(elem)
|
||||
elif s.typ.kind != tyGenericBody:
|
||||
#we likely got code of the form TypeA[TypeB] where TypeA is
|
||||
#not generic.
|
||||
localError(n.info, errNoGenericParamsAllowedForX, s.name.s)
|
||||
return newOrPrevType(tyError, prev, c)
|
||||
else:
|
||||
internalAssert s.typ.kind == tyGenericBody
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue