mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
Fix hintXDeclaredButNotUsed for enum fields marked as used
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -31,5 +31,10 @@ block:
|
||||
implementArithOpsNew(int)
|
||||
echoAdd 3, 5
|
||||
|
||||
type
|
||||
MyEnum {.used.} = enum
|
||||
Val1, Val2, Val3
|
||||
|
||||
|
||||
static:
|
||||
echo "compile end"
|
||||
|
||||
Reference in New Issue
Block a user