Skip to content

Commit 0ab306f

Browse files
Rashmi Makhejafacebook-github-bot
Rashmi Makheja
authored andcommitted
Don't generate IFF functions for hack
Summary: Interactions factory functions are not supported in hack client or server. Current generated code is incorrect and should not be used. Reviewed By: iahs Differential Revision: D59624676 fbshipit-source-id: 63c66b29b48325ec1f3b8daddbaafbd52dc77df7
1 parent d3fdcf4 commit 0ab306f

File tree

3 files changed

+154
-1531
lines changed

3 files changed

+154
-1531
lines changed

thrift/compiler/generate/t_hack_generator.cc

+10-5
Original file line numberDiff line numberDiff line change
@@ -1044,10 +1044,8 @@ class t_hack_generator : public t_concat_generator {
10441044
std::vector<const t_function*> funcs;
10451045
for (auto func : tservice->get_functions()) {
10461046
if (!is_client_only_function(func) &&
1047-
!func->is_interaction_constructor()) {
1048-
if (async || !func->sink_or_stream()) {
1049-
funcs.push_back(func);
1050-
}
1047+
is_function_supported(func, async)) {
1048+
funcs.push_back(func);
10511049
}
10521050
}
10531051
return funcs;
@@ -1057,14 +1055,21 @@ class t_hack_generator : public t_concat_generator {
10571055
const t_service* tservice) {
10581056
auto funcs = get_supported_server_functions(tservice, true);
10591057
for (auto func : tservice->get_functions()) {
1060-
if (is_client_only_function(func)) {
1058+
if (is_client_only_function(func) && is_function_supported(func)) {
10611059
funcs.push_back(func);
10621060
}
10631061
}
10641062
return funcs;
10651063
}
10661064

1065+
bool is_function_supported(const t_function* func, bool async = true) {
1066+
return !func->interaction() && (async || !func->sink_or_stream());
1067+
}
1068+
10671069
bool is_client_only_function(const t_function* func) {
1070+
if (func->is_interaction_constructor()) {
1071+
return true;
1072+
}
10681073
if (server_stream_) {
10691074
return func->sink();
10701075
}

0 commit comments

Comments
 (0)