From 48eccb83dbd10168ea8bfbace3aaafcfdee67447 Mon Sep 17 00:00:00 2001 From: nurbo Date: Thu, 11 Sep 2025 17:36:15 +0200 Subject: [PATCH] fix(idl_gen_ts): bool to number conversion in mutable API (#8677) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Björn Harrtell --- src/idl_gen_ts.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/idl_gen_ts.cpp b/src/idl_gen_ts.cpp index 835ba4416..14d42dc64 100644 --- a/src/idl_gen_ts.cpp +++ b/src/idl_gen_ts.cpp @@ -1903,12 +1903,13 @@ class TsGenerator : public BaseGenerator { code += " return false;\n"; code += " }\n\n"; - // special case for bools, which are treated as uint8 code += " " + GenBBAccess() + write_method + "(this.bb_pos + offset, "; - if (field.value.type.base_type == BASE_TYPE_BOOL) { code += "+"; } } + // special case for bools, which are treated as uint8 + if (field.value.type.base_type == BASE_TYPE_BOOL) { code += "+"; } + code += "value);\n"; code += " return true;\n"; code += "}\n\n";