I would expect the lexical extent of these scopes to be a single file, and all the files of the package, respectively. We could make them nonzero, or document the status quo.
If we make them nonzero, we'll need to make Scope.LookupParent aware of file and packages since the pos check should be ignored for these scopes. That's easy enough, and I think we should do it, but only for file scopes.
If we make the extent of a Package scope nonzero, then a package formed from two calls to checker.Files would need its scope extent to be expanded. Since the second list of ast.Files does not usually immediately follow the first, this would result in a package whose scope extent contains the scope extent of other files and packages, which would be very confusing. So I propose that we don't change the extent of the Package scope but merely document it as zero.
The text was updated successfully, but these errors were encountered: