From 0315d818805343368c14bf324634a51fc4e6c999 Mon Sep 17 00:00:00 2001 From: Satish Kumar Date: Tue, 14 Jan 2025 07:26:32 -0800 Subject: [PATCH] Improve the error message for arraysets without hack_collections 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 --- thrift/compiler/generate/t_hack_generator.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/thrift/compiler/generate/t_hack_generator.cc b/thrift/compiler/generate/t_hack_generator.cc index 2bd24abd791..ffc36930d60 100644 --- a/thrift/compiler/generate/t_hack_generator.cc +++ b/thrift/compiler/generate/t_hack_generator.cc @@ -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.");