Don't generate declarations of built-in constants declared in .hhi files
commit4b17c77290c861e4f44f0258e95e1df7fd0a5f25
authorSasha Manzyuk <manzyuk@fb.com>
Tue, 29 Oct 2019 16:14:07 +0000 (29 09:14 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 29 Oct 2019 16:16:09 +0000 (29 09:16 -0700)
treedce959f314f763a9e5bf05a1cff41d70ff9be816
parent567aec4c2d780c2be95129279e5b1564be297522
Don't generate declarations of built-in constants declared in .hhi files

Summary: We currently only avoid generating declarations for "pseudo-constants" (like `__FILE__` and `__CLASS__`) but there are other built-in constants, like `PHP_INT_MAX`, which are declared in `.hhi` files.  We must not generate declarations of those as doing so produces an error when type checking the output with `hh_single_type_check`.

Reviewed By: andrewjkennedy

Differential Revision: D18171538

fbshipit-source-id: a5086bc524bc1b767e6ec5be75d5d614cd258724
hphp/hack/src/server/serverExtractStandalone.ml
hphp/hack/test/integration/data/dependencies/expected/__with_built_in_constant.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/toplevel.php
hphp/hack/test/integration/test_extract_standalone.py