diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-12-16 09:15:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-16 09:15:56 +0100 |
commit | 20d9dd1ac64dc3c498f0a274cb717b5470993b59 (patch) | |
tree | 08e05eec3820dfc20d342ede80605e7b8b5a86d8 | |
parent | 4222b551ed1182c3a03d7da6b912f1d42fd5e726 (diff) | |
parent | c673607d36d618649524bbf96008f487213ef999 (diff) | |
download | Nim-20d9dd1ac64dc3c498f0a274cb717b5470993b59.tar.gz |
Merge pull request #10003 from nc-x/fix-enum-internal-error
Fix internal error when casting to invalid enum value
-rw-r--r-- | compiler/semfold.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 9e7ed5cee..0bdd0b64c 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -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 |