diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 2fb4e52411..db03ac2e05 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -169,7 +169,7 @@ 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, skEnumField}: # 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 diff --git a/tests/pragmas/tused.nim b/tests/pragmas/tused.nim index 83c62b7bbf..dce8541469 100644 --- a/tests/pragmas/tused.nim +++ b/tests/pragmas/tused.nim @@ -31,5 +31,11 @@ block: implementArithOpsNew(int) echoAdd 3, 5 +# issue #9896 +type + MyEnum {.used.} = enum + Val1, Val2, Val3 + + static: echo "compile end"