Lower context constants
commitc4808cea013adf999e4d03e97d6962e8f07d8f64
authorDavid Snider <dizzy@fb.com>
Mon, 21 Dec 2020 00:43:40 +0000 (20 16:43 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 21 Dec 2020 00:50:48 +0000 (20 16:50 -0800)
treefd4d5f389613c4dd70a6d960b639af3152137dff
parentb9c8c6c4acdd24958d27db6bdafb68486893e4ab
Lower context constants

Summary:
This is noted inline, but this doesn't quite work

We made the decision that we're going to lower context constants into standard type constants, but that doesn't quite work
 1. type constants allow only 1 constraint
2. type constants don't record the *type* of the constraint

These both need to be fixed or we need to lower to something else. In the meantime, I just grabbed the first one if it exists.

At the very least, this diff should make it very easy to make these changes.

Reviewed By: losvald

Differential Revision: D25654641

fbshipit-source-id: 3b4608db021500cf8f7b1212f2cfa4581998f8c6
hphp/hack/src/hhbc/emit_type_constant.rs
hphp/hack/src/parser/lowerer/lowerer.rs
hphp/hack/test/nast/coeffects_ctx_const.php [new file with mode: 0644]
hphp/hack/test/nast/coeffects_ctx_const.php.exp [new file with mode: 0644]
hphp/hack/test/nast/coeffects_ctx_const2.php [new file with mode: 0644]
hphp/hack/test/nast/coeffects_ctx_const2.php.exp [new file with mode: 0644]
hphp/hack/test/nast/coeffects_ctx_const_abstract.php [new file with mode: 0644]
hphp/hack/test/nast/coeffects_ctx_const_abstract.php.exp [new file with mode: 0644]
hphp/hack/test/nast/coeffects_ctx_const_fail.php [new file with mode: 0644]
hphp/hack/test/nast/coeffects_ctx_const_fail.php.exp [new file with mode: 0644]
hphp/test/slow/coeffects/ctx_const.php