Add conflicting concrete typeconst check, change class const map to not consider...
commitd0b507bb249cd41ff8e2863b1479374932c4e3e2
authorVassil Mladenov <vmladenov@fb.com>
Wed, 11 May 2022 18:15:24 +0000 (11 11:15 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 11 May 2022 18:15:24 +0000 (11 11:15 -0700)
tree54fab1baba54f1eb70162e480f8d21e95d5a7aef
parent38a11e61a56d0b0b15c017db7a2d165ff142dfc2
Add conflicting concrete typeconst check, change class const map to not consider synthesized members

Summary:
In D35886138 (https://github.com/facebook/hhvm/commit/87e647e38f1bba1d3cea52836c9bdb443e91da7b) I added a check for class const conflicts that covered type consts via their backing TypeStructure consts. However, these constants are marked synthesized by decl.

The diff did not filter synthesized consts from the map, which caused errors in hierarchies that resemble the test case. Filtering out synthesized constants therefore caused loss of errors on the TypeStructure constants.

This just adds the same const check for type constants. I looked into trying to abstract away the common bits, but the `class_const` and `typeconst` records are just slightly different enough to where the abstracted version is as verbose as this one.

Reviewed By: CatherineGasnier

Differential Revision: D36262334

fbshipit-source-id: d10f21096daac4f706002dfcf5fd57bae7b46974
hphp/hack/src/typing/typing_extends.ml
hphp/hack/test/typecheck/stricter_consts/synthesized_const_no_conflict.php [new file with mode: 0644]
hphp/hack/test/typecheck/stricter_consts/synthesized_const_no_conflict.php.exp [new file with mode: 0644]