feat: Support union underlying type for TS/JS (#7961)

This commit is contained in:
sssooonnnggg
2023-05-16 04:18:49 +08:00
committed by GitHub
parent 1d3afb90c5
commit b128b802d9
6 changed files with 58 additions and 8 deletions

View File

@@ -845,7 +845,7 @@ void ParseUnionTest() {
// Test union underlying type
const char *source = "table A {} table B {} union U : int {A, B} table C {test_union: U; test_vector_of_union: [U];}";
flatbuffers::Parser parser3;
parser3.opts.lang_to_generate = flatbuffers::IDLOptions::kCpp;
parser3.opts.lang_to_generate = flatbuffers::IDLOptions::kCpp | flatbuffers::IDLOptions::kTs;
TEST_EQ(parser3.Parse(source), true);
parser3.opts.lang_to_generate &= flatbuffers::IDLOptions::kJava;