disallow declaring XHP attributes as nullable and required
commitdf523afa801202e6a9570723854efcde7b438d2b
authorNick Gavalas <njg@fb.com>
Tue, 19 Dec 2017 21:53:39 +0000 (19 13:53 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 19 Dec 2017 22:16:28 +0000 (19 14:16 -0800)
tree8f768d9168fd0302a88b71d92885c46e71a996cb
parentd7db37cbb529b83b2e3f042429c82fd87f49db59
disallow declaring XHP attributes as nullable and required

Summary: This is actually not allowed. When we validate attributes, we don't differentiate between null and missing -- null *means* that the attribute should be treated as if it wasn't there and if available, it means to use a default. This should not be declarable because it makes no sense with XHP's type system. This may be changed going forward as we differentiate between nullable and optional attributes, but this is a good step forward.

Reviewed By: usikder

Differential Revision: D6595326

fbshipit-source-id: aabee05baa7f9c5a23fbab8261a0651f35496461
hphp/hack/src/naming/naming.ml
hphp/hack/src/utils/errors/errors.ml
hphp/hack/src/utils/errors/errors_sig.ml
hphp/hack/test/typecheck/xhp_nullable_required.php [new file with mode: 0644]
hphp/hack/test/typecheck/xhp_nullable_required.php.exp [new file with mode: 0644]