declare_folded_class NO LONGER _in_file
Summary:
If we were typechecking a.php, and we had to fold class C, then we used to invoke
```
declare_folded_class_in_file ctx "c.php" "C"
```
That filename "c.php" used to be used, I think, as the filename under which errors were reported in the errors.ml function "let add_error ...". It was introduced in
D4113886 (https://github.com/facebook/hhvm/commit/
67934a66fd9b50d64789eeb55da32099a756d7a6) (Nov 2016) and undone in
D6730499 (https://github.com/facebook/hhvm/commit/
8b1b511a3bc036f5429e8151b0c60211ea0a616d) (Jan 2018). The state since Jan 2018 is that now, when it reports errors during decling, then it reports them with respect to the current file we're typechecking.
The old behavior was quite dodgy. We have a cast-iron invariant that any errors that arise during typechecking of file a.php must be reported as coming from a.php. The errors that arise during decling don't fit into this paradigm, and therefore there must be no errors that arise during decling, but if they are then they should still be reported in a.php. (I believe they are).
Anyway, the upshot is that since Jan 2018, even though we used to pass in a filename, we never used that filename.
This diff removes the filename.
## How to read this diff
1. Start with errors.ml. That shows that the filename is no longer used; I replace `in_lazy_decl: Relative_path.t option ref` with `in_lazy_decl: bool ref`.
2. Next read typing_classes_heap.ml. It used to fetch the class's path. Now it merely tests whether the class exists.
3. Next read decl_provider.ml. It used to be that if typing_classes_heap had read the path for the pathname but it failed to class_decl then it would raise an exception "<class> not found in <file>". Now in this case it just raises the exception "<class> not found". (After all, we're looking for the class everywhere, not just in one specific file).
4. The rest of the changes are just straightforward consequences of renaming and removing the filename parameter
Reviewed By: CatherineGasnier
Differential Revision:
D41321333
fbshipit-source-id:
40066b1bacf83dfd3eee5a3b457294e54a0bebab