summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndrii Riabushenko <cdome@bk.ru>2018-12-08 11:35:18 +0000
committerAndrii Riabushenko <cdome@bk.ru>2018-12-08 11:35:18 +0000
commit94a63eef9a5da8441d17e1f5214c1823056bcf68 (patch)
treef069314fab297e7cbd2a418f9144ef23e8fd310f /compiler
parent160a03464310d8a9e1ffaf83d73904df3439df78 (diff)
downloadNim-94a63eef9a5da8441d17e1f5214c1823056bcf68.tar.gz
Fix hintXDeclaredButNotUsed for enum fields marked as used
Diffstat (limited to 'compiler')
-rw-r--r--compiler/lookups.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/lookups.nim b/compiler/lookups.nim
index 2fb4e5241..91d6bd745 100644
--- a/compiler/lookups.nim
+++ b/compiler/lookups.nim
@@ -169,7 +169,8 @@ proc ensureNoMissingOrUnusedSymbols(c: PContext; scope: PScope) =
             getSymRepr(c.config, s))
       inc missingImpls
     elif {sfUsed, sfExported} * s.flags == {}:
-      if s.kind notin {skForVar, skParam, skMethod, skUnknown, skGenericParam}:
+      if s.kind notin {skForVar, skParam, skMethod, skUnknown, skGenericParam} and 
+        not (s.kind == skEnumField and {sfUsed, sfExported} * s.owner.flags != {}):
         # XXX: implicit type params are currently skTypes
         # maybe they can be made skGenericParam as well.
         if s.typ != nil and tfImplicitTypeParam notin s.typ.flags and