Fix hackfmt for context aliases
commit8c7abad3799010f66c097fcbd2d0debdc6dc9a99
authorVassil Mladenov <vmladenov@fb.com>
Thu, 4 Nov 2021 08:43:38 +0000 (4 01:43 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 4 Nov 2021 08:45:06 +0000 (4 01:45 -0700)
treeffd7b88337ce00ac7aa87b1399e516754693a0a7
parent3c043303321dc3beab831763960ed8728317a527
Fix hackfmt for context aliases

Summary: {D28979231 (https://github.com/facebook/hhvm/commit/ccb78305da1e1a030e148c91f386a1949a789405)} wrote the formatting logic for ContextAliasDeclaration to share that of AliasDeclaration, but the syntax differs in that `ctx_alias_as_constraint` is a SyntaxList and the `= [...]` is optional for context aliases. The `t env type_constraint` was throwing an exception that SyntaxList should not be handled directly (line 99 of hack_format.ml). This fixes that.

Reviewed By: francesco-zappa-nardelli

Differential Revision: D32161597

fbshipit-source-id: e6d3b28464695fc6fc381d0498f75f4db39916ba
hphp/hack/src/hackfmt/hack_format.ml
hphp/hack/test/hackfmt/tests/effect_encapsulation.php [new file with mode: 0644]
hphp/hack/test/hackfmt/tests/effect_encapsulation.php.exp [new file with mode: 0644]