From 5b898deb41922ae8763fed0f3616295c01545181 Mon Sep 17 00:00:00 2001 From: nrockenbach <105754017+nrockenbach@users.noreply.github.com> Date: Tue, 28 Feb 2023 13:15:09 -0800 Subject: [PATCH] Fix UnusedUseClauseLinter to handle EnumClassLabelExpression nodes (#541) Co-authored-by: Nathan Rockenbach --- src/get_unresolved_referenced_names.hack | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/get_unresolved_referenced_names.hack b/src/get_unresolved_referenced_names.hack index d6d1445e8..8be0a07b5 100644 --- a/src/get_unresolved_referenced_names.hack +++ b/src/get_unresolved_referenced_names.hack @@ -98,6 +98,13 @@ function get_unresolved_referenced_names(Node $root): shape( $ret['namespaces'][] = C\firstx($parts); } } + + if ($node is EnumClassLabelExpression) { + $name = $node->getQualifier() ?as NameToken; + if ($name !== null) { + $ret['types'][] = $name->getText(); + } + } } return $ret;