Skip to content

Commit

Permalink
Make continuation formal parameter a private member of closure
Browse files Browse the repository at this point in the history
Summary: The continuation of the coroutine is a private member of the closure.

Reviewed By: michaeltingley

Differential Revision: D4943480

fbshipit-source-id: 88a14f8d85a8ee53c341272f792837b616c63233
  • Loading branch information
ericlippert authored and hhvm-bot committed Apr 25, 2017
1 parent 2344396 commit 8794750
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions hphp/hack/src/parser/coroutine/coroutine_closure_generator.ml
Expand Up @@ -40,10 +40,12 @@ let generate_constructor_method
function_name
{ function_parameter_list; function_type; _; } =
let function_parameter_list = fix_up_parameter_list function_parameter_list in
let cont_param = make_continuation_parameter_syntax
~visibility_syntax:private_syntax function_type in
let sm_param = make_state_machine_parameter_syntax
classish_name function_name in
let function_parameter_list =
(make_continuation_parameter_syntax function_type)::
(make_state_machine_parameter_syntax classish_name function_name)::
function_parameter_list in
cont_param :: sm_param :: function_parameter_list in
let ctor = make_constructor_decl_header_syntax
constructor_member_name function_parameter_list in
make_methodish_declaration_syntax ctor []
Expand Down
5 changes: 4 additions & 1 deletion hphp/hack/src/parser/coroutine/coroutine_syntax.ml
Expand Up @@ -319,8 +319,11 @@ let make_continuation_type_syntax return_type_syntax =
"CoroutineContinuation"
[return_type_syntax]

let make_continuation_parameter_syntax return_type_syntax =
let make_continuation_parameter_syntax
?visibility_syntax
return_type_syntax =
make_parameter_declaration_syntax
?visibility_syntax
(make_continuation_type_syntax return_type_syntax)
continuation_variable

Expand Down

0 comments on commit 8794750

Please sign in to comment.