Skip to content

Commit

Permalink
Improve the error message for arraysets without hack_collections
Browse files Browse the repository at this point in the history
Summary: When `arraysets` appear as an explicit compiler option, they must appear with `hack_collections`. Change the error message to indicate this expectation.

Reviewed By: rmakheja

Differential Revision: D68140232

fbshipit-source-id: 69f75f295dee6395e7b48c18c0cf68ae7cb2d52e
  • Loading branch information
Satish Kumar authored and facebook-github-bot committed Jan 14, 2025
1 parent 187238d commit 0315d81
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions thrift/compiler/generate/t_hack_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ class t_hack_generator : public t_concat_generator {
// legacy_arrays_ is only used to migrate away from php gen
if (legacy_arrays_ && strict_types_) {
throw std::runtime_error("Don't use legacy_arrays with strict_types");
} else if (arraysets_ && !(legacy_arrays_ || hack_collections_)) {
throw std::runtime_error(
"Don't use arraysets without either legacy_arrays or hack_collections");
} else if (!legacy_arrays_ && arraysets_ && !hack_collections_) {
throw std::runtime_error("Don't use arraysets without hack_collections");
} else if (mangled_services_ && has_hack_namespace) {
throw std::runtime_error(
"Don't use mangledsvcs with hack namespaces or package.");
Expand Down

0 comments on commit 0315d81

Please sign in to comment.