Fix internal error when casting to invalid enum value
This commit is contained in:
parent
50193b95ea
commit
c673607d36
1 changed files with 3 additions and 1 deletions
|
|
@ -132,7 +132,9 @@ proc ordinalValToString*(a: PNode; g: ModuleGraph): string =
|
||||||
return field.name.s
|
return field.name.s
|
||||||
else:
|
else:
|
||||||
return field.ast.strVal
|
return field.ast.strVal
|
||||||
internalError(g.config, a.info, "no symbol for ordinal value: " & $x)
|
localError(g.config, a.info,
|
||||||
|
"Cannot convert int literal to $1. The value is invalid." %
|
||||||
|
[typeToString(t)])
|
||||||
else:
|
else:
|
||||||
result = $x
|
result = $x
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue