Tweak is_constant_reason check
Tweak is_constant_reason check

Summary:
This logic causes unexpected behavior in collect_of_types. The intent is to
treat variable declarations like `const FOO = "FOO"` as a kind of pseudo
annotation, which can be fully resolved in one step.

However, the RIdentifier case matches many things, including class declarations
which happen to use a single-letter name. Treating classes as annotations
causes full type resolution which can have the unfortunate effect of scrubbing
out tvars with any in the class, causing Flow to miss errors.

Reviewed By: avikchaudhuri

Differential Revision: D10237592

fbshipit-source-id: 261a3de922d7527fa3f810bb4e292ee6477e18e0

nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow