Improve the "invalid parent scope" linter rule
Summary: This linter rule was introduced in D12420, but fails to handle a specific edge case.
Test Plan: Added test case.
Reviewers: Blessed Reviewers, epriestley
Reviewed By: Blessed Reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12853