summary refs log tree commit diff stats
path: root/compiler/enumtostr.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2022-10-10 21:40:07 +0200
committerGitHub <noreply@github.com>2022-10-10 21:40:07 +0200
commit08ae3467b9b3f52fa568bbf06a9057a87020158b (patch)
treee125729b8b989ce2d9b2bd88f3b494d0900a3166 /compiler/enumtostr.nim
parente290b028aba9fd50a69ed8c0346ee323f9287a13 (diff)
downloadNim-08ae3467b9b3f52fa568bbf06a9057a87020158b.tar.gz
refactorings (#20536)
* refactoring

* refactoring: removed unused macroUsagesSection

* enum instead of bool for better readability
Diffstat (limited to 'compiler/enumtostr.nim')
-rw-r--r--compiler/enumtostr.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/enumtostr.nim b/compiler/enumtostr.nim
index 4a28d066c..f8b3744d5 100644
--- a/compiler/enumtostr.nim
+++ b/compiler/enumtostr.nim
@@ -30,7 +30,7 @@ proc genEnumToStrProc*(t: PType; info: TLineInfo; g: ModuleGraph; idgen: IdGener
     assert(t.n[i].kind == nkSym)
     var field = t.n[i].sym
     let val = if field.ast == nil: field.name.s else: field.ast.strVal
-    caseStmt.add newTree(nkOfBranch, newSymNode(field),
+    caseStmt.add newTree(nkOfBranch, newIntTypeNode(field.position, t),
       newTree(nkStmtList, newTree(nkFastAsgn, newSymNode(res), newStrNode(val, info))))
     #newIntTypeNode(nkIntLit, field.position, t)