Fix hintXDeclaredButNotUsed for enum fields marked as used

This commit is contained in:
Andrii Riabushenko 2018-12-08 11:35:18 +00:00
commit 94a63eef9a
2 changed files with 7 additions and 1 deletions

View file

@ -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