Skip to content

Commit

Permalink
Fix UnusedUseClauseLinter to handle EnumClassLabelExpression nodes (#541
Browse files Browse the repository at this point in the history
)

Co-authored-by: Nathan Rockenbach <[email protected]>
  • Loading branch information
nrockenbach and Nathan Rockenbach authored Feb 28, 2023
1 parent c67eaf7 commit 5b898de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/get_unresolved_referenced_names.hack
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5b898de

Please sign in to comment.