-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split internal vs access not allowed errors
Summary: I'm working on a refactor that will allow us to model attribute actions in a descriptor-oriented way where get and set have separate type information. One of the big issues getting in my way was that the `attr.rs` LookupResult type was conflating two kinds of problems that don't belong together under the `Error` variant: - internal errors, which are actually just bugs in Pyre2 and occur when we completely fail to resolve an attribute - errors caused by a lookup being on an illegal action (which are very similar to `NotFound`, except that they happen when we *did* find the attribute and we just don't want to allow the access, e.g. class object access on an instance-only member) I really need these to be clearly distinguished because the first category of error really does belong in `LookupResult` itself, but the second category probably should live at a lower level attached to attribute *actions* (and actually gets detected inside of `classes.rs`). This diff makes the split. Reviewed By: ndmitchell Differential Revision: D68687295 fbshipit-source-id: 98ecbaf1936ec7b60afb020b3d3fbde41cbeee74
- Loading branch information
1 parent
d831c96
commit bc92c99
Showing
2 changed files
with
36 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters