Merge pull request #10003 from nc-x/fix-enum-internal-error

Fix internal error when casting to invalid enum value
This commit is contained in:
Andreas Rumpf
2018-12-16 09:15:56 +01:00
committed by GitHub

View File

@@ -132,7 +132,9 @@ proc ordinalValToString*(a: PNode; g: ModuleGraph): string =
return field.name.s
else:
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:
result = $x