Added null coalesce operator to Hack typechecker
commit47336f15533f49dc86bad0d0577304a4bc753e8d
authorGulshan Singh <gulshan@fb.com>
Wed, 23 Sep 2015 21:13:13 +0000 (23 14:13 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Thu, 24 Sep 2015 16:38:50 +0000 (24 09:38 -0700)
tree509879b3f5d2124e6612ec89c33374b46997337e
parent441217b0caf6bf7d4c15e14bb98e746dc274cda0
Added null coalesce operator to Hack typechecker

Summary: Made the condition expression used with the null coalesce operator (`??`) desugar into `expr === null`. Formatting isn't implemented yet.

Reviewed By: @dlreeves, @int3

Differential Revision: D2434541
18 files changed:
hphp/hack/src/emitter/emitter_expr.ml
hphp/hack/src/format/format_hack.ml
hphp/hack/src/h2tp/common/ast_ext.ml
hphp/hack/src/h2tp/mapper/map_ast.ml
hphp/hack/src/h2tp/unparser/unparser.ml
hphp/hack/src/hh_matcher/astConstructor.ml
hphp/hack/src/hh_matcher/astVisitor.ml
hphp/hack/src/naming/naming.ml
hphp/hack/src/naming/nast.ml
hphp/hack/src/naming/nastVisitor.ml
hphp/hack/src/parsing/ast.ml
hphp/hack/src/parsing/lexer_hack.mll
hphp/hack/src/parsing/parser_hack.ml
hphp/hack/src/typing/nastCheck.ml
hphp/hack/src/typing/nastInitCheck.ml
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/null_coalesce.php [new file with mode: 0644]
hphp/hack/test/typecheck/null_coalesce.php.exp [new file with mode: 0644]