Fix enum regression
This commit is contained in:
parent
7a66616d74
commit
b0f860d90f
1 changed files with 2 additions and 0 deletions
|
|
@ -90,6 +90,8 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType =
|
|||
if sonsLen(v) == 2:
|
||||
strVal = v.sons[1] # second tuple part is the string value
|
||||
if skipTypes(strVal.typ, abstractInst).kind in {tyString, tyCString}:
|
||||
if not isOrdinalType(v.sons[0].typ):
|
||||
localError(c.config, v.sons[0].info, errOrdinalTypeExpected)
|
||||
x = getOrdValue(v.sons[0]) # first tuple part is the ordinal
|
||||
else:
|
||||
localError(c.config, strVal.info, errStringLiteralExpected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue