legacy decl parser should pick up scc_refs from FunctionPointersnightly-2021.04.22
commit8c173160bb6b8e56277a04d00efe4c1a234b605c
authorLucian Wischik <ljw@fb.com>
Thu, 22 Apr 2021 01:13:25 +0000 (21 18:13 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 22 Apr 2021 01:15:49 +0000 (21 18:15 -0700)
treed9413ebe6fe8d46d0d984045dfb190f9695b64f5
parenta477b5ac683ae4be98b46382a041e6c77b2705f3
legacy decl parser should pick up scc_refs from FunctionPointers

Summary:
```
const mixed X = S::F;
const mixed Y = S::f();
const mixed Z = S::f<>;
```
What are the "scc_refs" that we need to track for cyclic initializers?
* X: does need to track S::F, and legacy-decl does, and direct-decl does
* Y: arguable whether it should track S::f; legacy-decl does and direct-decl does
* Z: doesn't need to track S::f; legacy-decl doesn't but direct-decl does

We're not going to change the way the direct-decl-parser works for "Z". Our goal of keeping it slim and lightweight is more important than correctness.

Therefore, this diff changes the legacy-decl parser for "Z" to bring its behavior in accord with the direct-decl-parser.

Reviewed By: vsiles

Differential Revision: D27836472

fbshipit-source-id: 8bf632a51af00e53af7d87c7553debb5048a1de8
hphp/hack/src/decl/shallow_decl.ml
hphp/hack/test/decl/consts_misc2.php.exp