summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-12-16 09:15:56 +0100
committerGitHub <noreply@github.com>2018-12-16 09:15:56 +0100
commit20d9dd1ac64dc3c498f0a274cb717b5470993b59 (patch)
tree08e05eec3820dfc20d342ede80605e7b8b5a86d8
parent4222b551ed1182c3a03d7da6b912f1d42fd5e726 (diff)
parentc673607d36d618649524bbf96008f487213ef999 (diff)
downloadNim-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.nim4
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