Correctly skip generating a stub for the dependency on the target method
commitc4771dd085f187570f8a34f647fb8b1da72618db
authorSasha Manzyuk <manzyuk@fb.com>
Wed, 8 Jan 2020 12:24:01 +0000 (8 04:24 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 8 Jan 2020 12:28:09 +0000 (8 04:28 -0800)
treea3f189d240e18467556c1c1da2f68c46e56543a9
parente6b685e9222d7cad73fa9ee71131574f7bac3479
Correctly skip generating a stub for the dependency on the target method

Summary: We incorrectly test if a given `Method` or `SMethod` dependency is on the target method that is being extracted: we only check if the method names are the same, and we don't check if the class names are also the same, which results in us not generating stubs for methods whose names match the target method name.  One example where this manifests itself is when the target method has an `<<__Override>>` attribute: in this case, we don't generate the parent, overridden method, which results in a type error in the extracted code.

Reviewed By: Wilfred

Differential Revision: D19300707

fbshipit-source-id: 13499159a31923d157f13d0fb7465892a1308e1b
hphp/hack/src/server/serverExtractStandalone.ml
hphp/hack/test/integration/data/dependencies/classes.php
hphp/hack/test/integration/data/dependencies/expected/__Derived++overridden.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__ImplementingBase++must_implement.php.exp
hphp/hack/test/integration/test_extract_standalone.py