diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 60550de570acc..07229bfa68250 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -141,6 +141,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = result.n.add symNode styleCheckDef(c, e) onDef(e.info, e) + suggestSym(c.graph, e.info, e, c.graph.usageSym) if sfGenSym notin e.flags: if not isPure: addInterfaceOverloadableSymAt(c, c.currentScope, e) diff --git a/nimsuggest/tests/tuse_enum.nim b/nimsuggest/tests/tuse_enum.nim new file mode 100644 index 0000000000000..8a40a83489105 --- /dev/null +++ b/nimsuggest/tests/tuse_enum.nim @@ -0,0 +1,15 @@ +discard """ +$nimsuggest --tester $file +>use $1 +def;;skEnumField;;tuse_enum.Colour.Red;;Colour;;$file;;10;;4;;"";;100 +use;;skEnumField;;tuse_enum.Colour.Red;;Colour;;$file;;14;;8;;"";;100 +""" + +type + Colour = enum + Red + Green + Blue + +discard #[!]#Red +