Fix Resolutions of Methods/Funcs in HHBBC Index
commitf7a8228cbb24a76ee099c5f3850773c307d013e8
authorHanwen Wu <steinwaywu@fb.com>
Wed, 2 Aug 2017 00:28:42 +0000 (1 17:28 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 2 Aug 2017 00:47:57 +0000 (1 17:47 -0700)
tree8c0f320e2539c7eb0830fb4da8f54f4e290b6a07
parent4a13f2990539dc8d6599fad0ff54d428991dc8fd
Fix Resolutions of Methods/Funcs in HHBBC Index

Summary:
This diff has two parts.

**Part 1** fixes the resolution of methods in `resolve_method`. In single-unit mode, HHBBC can no longer conclude anything about traits, since we simply don't know about all the traits. Therefore, when resolving class/object methods, when HHBBC sees any trait usage, the best we can do is return a name-only resolution since we can't know if the method comes from traits or not.

**Part 2** fixes the resolution of functions (with/without fallback). The code is slightly reorganized around how many resolutions we have. In the case of single resolution, we distinguish an actual single resolution of a unique function, from a faux single resolution due to the lack of global knowledge.

Reviewed By: markw65

Differential Revision: D5452693

fbshipit-source-id: 21cc7f0dddc3542cb02e42ea4ad1154fb8e8ba66
hphp/hhbbc/index.cpp