summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2022-09-03 10:53:31 +0300
committerGitHub <noreply@github.com>2022-09-03 09:53:31 +0200
commita6189fbb988ae9c9e6760cb901e792e043b9086b (patch)
treeb392aab7a3f79d5d4aa4230699d56d688a35f370 /compiler
parent86f7f4ffa5b8d84cbff12afbcd9b88d3ceb429c8 (diff)
downloadNim-a6189fbb988ae9c9e6760cb901e792e043b9086b.tar.gz
only allow enums to overload enums + extra test (#20126)
mirror behavior without overloadableEnums
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 84d45b7df..42f720c48 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -2798,7 +2798,7 @@ proc enumFieldSymChoice(c: PContext, n: PNode, s: PSym): PNode =
   var i = 0
   var a = initOverloadIter(o, c, n)
   while a != nil:
-    if a.kind in OverloadableSyms-{skModule}:
+    if a.kind == skEnumField:
       inc(i)
       if i > 1: break
     a = nextOverloadIter(o, c, n)
@@ -2814,7 +2814,7 @@ proc enumFieldSymChoice(c: PContext, n: PNode, s: PSym): PNode =
     result = newNodeIT(nkClosedSymChoice, info, newTypeS(tyNone, c))
     a = initOverloadIter(o, c, n)
     while a != nil:
-      if a.kind in OverloadableSyms-{skModule}:
+      if a.kind == skEnumField:
         incl(a.flags, sfUsed)
         markOwnerModuleAsUsed(c, a)
         result.add newSymNode(a, info)