From c673607d36d618649524bbf96008f487213ef999 Mon Sep 17 00:00:00 2001 From: Neelesh Chandola Date: Sat, 15 Dec 2018 22:19:39 +0530 Subject: [PATCH] Fix internal error when casting to invalid enum value --- compiler/semfold.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 9e7ed5ceef..0bdd0b64c4 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