Elaborate in a given namespace the names of classes / interfaces in `require extends...
commit534ff32cc95d5a984b504356456c63e8e2b057d1
authorSasha Manzyuk <manzyuk@fb.com>
Mon, 2 Dec 2019 09:39:56 +0000 (2 01:39 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 2 Dec 2019 09:41:41 +0000 (2 01:41 -0800)
tree2336054ee787600bbf9d6970411cef8947dacc05
parentbea7c453b7609d87e7a75e994dd792ad9a932e43
Elaborate in a given namespace the names of classes / interfaces in `require extends` / `require implements` clauses

Summary:
I'm not sure why we don't do this already.  As a result,
```
class C<T> extends T {}
```
is a naming errors (unbound name) while
```
interface I<T> {
  require extends T;
}
```
is a type error.

(A related issue: because of elaboration of the name `T` in the former example to `\T`, the check if this name occurs in the list of type parameters of the class fails because the type parameter names are not elaborated (duh), but in the latter example because `T` is not elaborated the check succeeds and `T` is transformed from `Happly ((_, "T"), [])` into `Habstr "T"`.)

Reviewed By: kmeht

Differential Revision: D18749656

fbshipit-source-id: 1b56c52840d2ff331e10ebb5a7dce895c82727ce
hphp/hack/src/parser/namespaces.ml
hphp/hack/test/typecheck/require_implements_generic.php.exp