hhvm / hsl-experimental

Experimental features for the Hack Standard Library
MIT License
23 stars 10 forks source link

DO NOT COMMIT: move HH\Lib\OS to HH\Staging\OS #178

Closed fredemmott closed 3 years ago

fredemmott commented 3 years ago

Summary:

Within FB, we need to do a change like this to avoid namign conflicts when we add the HSL to HHVM and the typechecker.

I've done this one first as it's the most complicated, as there is a native type that is public, HH\Lib\FileDescriptor - as it's never newed up directly, a type alias works fine.

- find src tests -type f | xargs gsed -i 's,HH\\Lib\\OS,HH\\Staging\\OS,g'
- find src tests -type f -name ‘*.php’ | xargs gawk -i inplace '{ if ($0 ~ /, OS[,}]/) { print "use namespace HH\\Staging\\OS;"; print gensub(/, OS([,}])/,"\\1", "g", $0)} else { print $0 }}'
- find src tests -type f -name ‘*.php’ | xargs gawk -i inplace '{ if ($0 ~ /{OS, /) { print "use namespace HH\\Staging\\OS;"; print gensub(/{OS, /,"{", "g", $0)} else { print $0 }}'

Finally, manually added the TypeDescriptor alias

Worked on this on a public checkout for faster dev cycle

Test plan:

hh_client, unit tests

facebook-github-bot commented 3 years ago

@fredemmott has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.