Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Right now, we drop the expression in assert nodes. This adds it back. Reviewed By: jamesjwu Differential Revision: D5555247 fbshipit-source-id: 76771f4ee077a5fee15d82f716aa891466024bda
- Loading branch information
1 parent
27e4eec
commit 8115170
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?hh // strict | ||
/** | ||
* Copyright (c) 2014, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the "hack" directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
|
||
class A {} | ||
|
||
function foo(?A $x): void { | ||
assert($x instanceof A); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[(AnnotatedAST.Fun | ||
{ AnnotatedAST.f_mode = <opaque>; | ||
f_ret = (Some (<p>, (Hprim Tvoid))); | ||
f_name = (<p>, "\\foo"); f_tparams = []; | ||
f_where_constraints = []; f_variadic = AnnotatedAST.FVnonVariadic; | ||
f_params = | ||
[{ AnnotatedAST.param_hint = | ||
(Some (<p>, | ||
(Hoption | ||
(<p>, | ||
(Happly ((<p>, "\\A"), [])))))); | ||
param_is_reference = false; param_is_variadic = false; | ||
param_pos = <p>; param_name = "$x"; param_expr = None | ||
} | ||
]; | ||
f_body = | ||
(AnnotatedAST.NamedBody | ||
{ AnnotatedAST.fnb_nast = | ||
[(AnnotatedAST.Expr | ||
((Some void), | ||
(AnnotatedAST.Assert | ||
(AnnotatedAST.AE_assert | ||
((Some bool), | ||
(AnnotatedAST.InstanceOf ( | ||
((Some ?\A), | ||
(AnnotatedAST.Lvar (<p>, $x))), | ||
(AnnotatedAST.CI ((<p>, "\\A"), [])) | ||
))))))) | ||
]; | ||
fnb_unsafe = false }); | ||
f_fun_kind = FSync; f_user_attributes = [] }); | ||
(AnnotatedAST.Class | ||
{ AnnotatedAST.c_mode = <opaque>; c_final = false; c_is_xhp = false; | ||
c_kind = Cnormal; c_name = (<p>, "\\A"); | ||
c_tparams = <opaque>; c_extends = []; c_uses = []; | ||
c_xhp_attr_uses = []; c_xhp_category = []; c_req_extends = []; | ||
c_req_implements = []; c_implements = []; c_consts = []; | ||
c_typeconsts = []; c_static_vars = []; c_vars = []; | ||
c_constructor = None; c_static_methods = []; c_methods = []; | ||
c_user_attributes = []; c_enum = None }) | ||
] |