Squashed 'third_party/flatbuffers/' changes from bc44fad35..8aa8b9139

8aa8b9139 Fix handling of +/-inf defaults in TS/rust/go/dart codegen (#7588)
001adf782 Add support for parsing proto map fields (#7613)
dbc58ab77 Fix help output for --gen-includes (#7611)
2facfeec7 Fix missing spaces in flatc help text (#7612)
4de2814c7 Fix: arduino platform build (#7625)
37b1acdaf Fix current official name of macOS (#7627)
a22434e2a Add missing #include <algorithm> for std::min/std::max uses, and #include <limits> for std::numeric_limits<> (#7624)
214cc9468 Bump Rust version to 22.10.26 before publication (#7622)
a4ff275d9 Added option to not requires an EoF token when parsing JSON (#7620)
15f32c690 python: object generation prefix and suffix (#7565)
051afd882 Add CreateSharedString to python builder (#7608)
728c033ad Add check for presence of realpath to CMakeLists.txt to support more platforms (#7603)
4c514483d Update DartTest.sh golden files (#7606)
c2d9c2080 [TS] Add support for fixed length arrays on Typescript (#5864) (#7021) (#7581)
e34ae4c6b `build.yml`: Fix missing 'v' in version
e54536127 `build.yml` Update to Kotlin Wrapper 1.0.5
49d9f941c `release.yml` Use env var for passphrase
cefc21c1f `release.yml` Add GPG key for Maven
3e64fa724 `release.yml`: Add Maven Steps
b15f3c57e `release_yml` Use new dotnet version
ff802c680 `release.yml` Use NuGet Key directly
b401957d5 `release.yml` Changed Push to follow examples
8c8151f8f `release.yml` Fix nuget push command
ebb7c203d `release.yml` Add Nuget support
203241ed3 FlatBuffers Version 22.10.26 (#7607)
ac485609c `setup.py`: Define version directly
de5b85aa6 `release.yml`: Switch to `python` directory
de3df2d88 `release.yml`: Add publishing to PyPi
043a24f2e [Python] Fixed the issue with nested unions relying on InitFromBuf. (#7576)
5a48b0d7d release.yml: Typo
ce307556f release.yml: Remove `npm ci`
cb616e27c Create release.yml (#7605)
a54ca1e75 FlatBuffers Version 22.10.25 (#7604)
5b3fadcc1 [vector] Allow to iterate with mutables (#7586)
872a49746 [Nim] Bfbs Nim Generator (#7534)
e30170296 Make type conversions explicit. (#7595)
f7b734438 Fix LongEnum definitions (#7596)
5792623df Rust fix compilation for no_std targets #2 (#7553)
0edb27528 Update Rust version (#7574)
acc6a20d3 tests/test.cpp contains a couple of tests that are only executed (#7571)
04cd037ba Fix #7580 by documenting union schema evolution rules (#7585)
e1c5db988 Turn on clippy for Rust and fix lints for non-generated code (#7575)
b80142b90 Update documentation to mention enum value attributes (#7570)
54418f371 Add support for metadata attributes for enum values (#7567) (#7568)
c92e78a9f FlatBuffers Version 22.9.29 (#7557)
d243b904c [TS] Make strict compliant and improve typings (#7549)
374f8fb5f Rust soundness fixes (#7518)
dadbff571 Moves swift package to root of repository so it can be used directly … (#7548)
76ddae006 FlatBuffers Version 22.9.24 (#7547)
cfe157ec5 Emit internal enums when swift_implementation_only (#7545)
413115858 [Python] Python fixed size array (#7529)
88046190e Upgrade grpc to 1.49.0 and make sure it builds (#7538)
72aa85a75 [C++] Rare bad buffer content alignment if sizeof(T) != alignof(T) (#7520)
bfceebb7f Fix conform (#7532)

git-subtree-dir: third_party/flatbuffers
git-subtree-split: 8aa8b9139eb330f27816a5b8b5bbef402fbe3632
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
Change-Id: I943faba499baf58e9f561b1e4734922188ba8626
diff --git a/tests/ts/reflection_generated.ts b/tests/ts/reflection_generated.ts
index 4bb1222..6b553b1 100644
--- a/tests/ts/reflection_generated.ts
+++ b/tests/ts/reflection_generated.ts
@@ -35,7 +35,7 @@
   DefaultVectorsAndStrings = '8'
 }
 
-export class Type {
+export class Type implements flatbuffers.IUnpackableObject<TypeT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):Type {
@@ -225,7 +225,7 @@
 }
 }
 
-export class TypeT {
+export class TypeT implements flatbuffers.IGeneratedObject {
 constructor(
   public baseType: BaseType = BaseType.None,
   public element: BaseType = BaseType.None,
@@ -248,7 +248,7 @@
 }
 }
 
-export class KeyValue {
+export class KeyValue implements flatbuffers.IUnpackableObject<KeyValueT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):KeyValue {
@@ -323,7 +323,7 @@
 }
 }
 
-export class KeyValueT {
+export class KeyValueT implements flatbuffers.IGeneratedObject {
 constructor(
   public key: string|Uint8Array|null = null,
   public value: string|Uint8Array|null = null
@@ -341,7 +341,7 @@
 }
 }
 
-export class EnumVal {
+export class EnumVal implements flatbuffers.IUnpackableObject<EnumValT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):EnumVal {
@@ -399,12 +399,22 @@
   return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
 }
 
+attributes(index: number, obj?:KeyValue):KeyValue|null {
+  const offset = this.bb!.__offset(this.bb_pos, 14);
+  return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
+}
+
+attributesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 14);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
 static getFullyQualifiedName():string {
   return 'reflection_EnumVal';
 }
 
 static startEnumVal(builder:flatbuffers.Builder) {
-  builder.startObject(5);
+  builder.startObject(6);
 }
 
 static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
@@ -435,6 +445,22 @@
   builder.startVector(4, numElems, 4);
 }
 
+static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(5, attributesOffset, 0);
+}
+
+static createAttributesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
+  builder.startVector(4, data.length, 4);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addOffset(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startAttributesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 4);
+}
+
 static endEnumVal(builder:flatbuffers.Builder):flatbuffers.Offset {
   const offset = builder.endObject();
   builder.requiredField(offset, 4) // name
@@ -447,7 +473,8 @@
     this.name(),
     this.value(),
     (this.unionType() !== null ? this.unionType()!.unpack() : null),
-    this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength())
+    this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
+    this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength())
   );
 }
 
@@ -456,16 +483,18 @@
   _o.name = this.name();
   _o.value = this.value();
   _o.unionType = (this.unionType() !== null ? this.unionType()!.unpack() : null);
-  _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength());
+  _o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
+  _o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
 }
 }
 
-export class EnumValT {
+export class EnumValT implements flatbuffers.IGeneratedObject {
 constructor(
   public name: string|Uint8Array|null = null,
   public value: bigint = BigInt('0'),
   public unionType: TypeT|null = null,
-  public documentation: (string)[] = []
+  public documentation: (string)[] = [],
+  public attributes: (KeyValueT)[] = []
 ){}
 
 
@@ -473,18 +502,20 @@
   const name = (this.name !== null ? builder.createString(this.name!) : 0);
   const unionType = (this.unionType !== null ? this.unionType!.pack(builder) : 0);
   const documentation = EnumVal.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
+  const attributes = EnumVal.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
 
   EnumVal.startEnumVal(builder);
   EnumVal.addName(builder, name);
   EnumVal.addValue(builder, this.value);
   EnumVal.addUnionType(builder, unionType);
   EnumVal.addDocumentation(builder, documentation);
+  EnumVal.addAttributes(builder, attributes);
 
   return EnumVal.endEnumVal(builder);
 }
 }
 
-export class Enum {
+export class Enum implements flatbuffers.IUnpackableObject<EnumT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):Enum {
@@ -656,11 +687,11 @@
 unpack(): EnumT {
   return new EnumT(
     this.name(),
-    this.bb!.createObjList(this.values.bind(this), this.valuesLength()),
+    this.bb!.createObjList<EnumVal, EnumValT>(this.values.bind(this), this.valuesLength()),
     this.isUnion(),
     (this.underlyingType() !== null ? this.underlyingType()!.unpack() : null),
-    this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()),
-    this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()),
+    this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
+    this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
     this.declarationFile()
   );
 }
@@ -668,16 +699,16 @@
 
 unpackTo(_o: EnumT): void {
   _o.name = this.name();
-  _o.values = this.bb!.createObjList(this.values.bind(this), this.valuesLength());
+  _o.values = this.bb!.createObjList<EnumVal, EnumValT>(this.values.bind(this), this.valuesLength());
   _o.isUnion = this.isUnion();
   _o.underlyingType = (this.underlyingType() !== null ? this.underlyingType()!.unpack() : null);
-  _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength());
-  _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength());
+  _o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
+  _o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
   _o.declarationFile = this.declarationFile();
 }
 }
 
-export class EnumT {
+export class EnumT implements flatbuffers.IGeneratedObject {
 constructor(
   public name: string|Uint8Array|null = null,
   public values: (EnumValT)[] = [],
@@ -710,7 +741,7 @@
 }
 }
 
-export class Field {
+export class Field implements flatbuffers.IUnpackableObject<FieldT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):Field {
@@ -1012,8 +1043,8 @@
     this.deprecated(),
     this.required(),
     this.key(),
-    this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()),
-    this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()),
+    this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
+    this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
     this.optional(),
     this.padding()
   );
@@ -1030,14 +1061,14 @@
   _o.deprecated = this.deprecated();
   _o.required = this.required();
   _o.key = this.key();
-  _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength());
-  _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength());
+  _o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
+  _o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
   _o.optional = this.optional();
   _o.padding = this.padding();
 }
 }
 
-export class FieldT {
+export class FieldT implements flatbuffers.IGeneratedObject {
 constructor(
   public name: string|Uint8Array|null = null,
   public type: TypeT|null = null,
@@ -1080,7 +1111,7 @@
 }
 }
 
-export class Object_ {
+export class Object_ implements flatbuffers.IUnpackableObject<Object_T> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):Object_ {
@@ -1294,12 +1325,12 @@
 unpack(): Object_T {
   return new Object_T(
     this.name(),
-    this.bb!.createObjList(this.fields.bind(this), this.fieldsLength()),
+    this.bb!.createObjList<Field, FieldT>(this.fields.bind(this), this.fieldsLength()),
     this.isStruct(),
     this.minalign(),
     this.bytesize(),
-    this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()),
-    this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()),
+    this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
+    this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
     this.declarationFile()
   );
 }
@@ -1307,17 +1338,17 @@
 
 unpackTo(_o: Object_T): void {
   _o.name = this.name();
-  _o.fields = this.bb!.createObjList(this.fields.bind(this), this.fieldsLength());
+  _o.fields = this.bb!.createObjList<Field, FieldT>(this.fields.bind(this), this.fieldsLength());
   _o.isStruct = this.isStruct();
   _o.minalign = this.minalign();
   _o.bytesize = this.bytesize();
-  _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength());
-  _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength());
+  _o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
+  _o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
   _o.declarationFile = this.declarationFile();
 }
 }
 
-export class Object_T {
+export class Object_T implements flatbuffers.IGeneratedObject {
 constructor(
   public name: string|Uint8Array|null = null,
   public fields: (FieldT)[] = [],
@@ -1350,7 +1381,7 @@
 }
 }
 
-export class RPCCall {
+export class RPCCall implements flatbuffers.IUnpackableObject<RPCCallT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):RPCCall {
@@ -1473,8 +1504,8 @@
     this.name(),
     (this.request() !== null ? this.request()!.unpack() : null),
     (this.response() !== null ? this.response()!.unpack() : null),
-    this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()),
-    this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength())
+    this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
+    this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength())
   );
 }
 
@@ -1483,12 +1514,12 @@
   _o.name = this.name();
   _o.request = (this.request() !== null ? this.request()!.unpack() : null);
   _o.response = (this.response() !== null ? this.response()!.unpack() : null);
-  _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength());
-  _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength());
+  _o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
+  _o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
 }
 }
 
-export class RPCCallT {
+export class RPCCallT implements flatbuffers.IGeneratedObject {
 constructor(
   public name: string|Uint8Array|null = null,
   public request: Object_T|null = null,
@@ -1516,7 +1547,7 @@
 }
 }
 
-export class Service {
+export class Service implements flatbuffers.IUnpackableObject<ServiceT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):Service {
@@ -1666,9 +1697,9 @@
 unpack(): ServiceT {
   return new ServiceT(
     this.name(),
-    this.bb!.createObjList(this.calls.bind(this), this.callsLength()),
-    this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()),
-    this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()),
+    this.bb!.createObjList<RPCCall, RPCCallT>(this.calls.bind(this), this.callsLength()),
+    this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
+    this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
     this.declarationFile()
   );
 }
@@ -1676,14 +1707,14 @@
 
 unpackTo(_o: ServiceT): void {
   _o.name = this.name();
-  _o.calls = this.bb!.createObjList(this.calls.bind(this), this.callsLength());
-  _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength());
-  _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength());
+  _o.calls = this.bb!.createObjList<RPCCall, RPCCallT>(this.calls.bind(this), this.callsLength());
+  _o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
+  _o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
   _o.declarationFile = this.declarationFile();
 }
 }
 
-export class ServiceT {
+export class ServiceT implements flatbuffers.IGeneratedObject {
 constructor(
   public name: string|Uint8Array|null = null,
   public calls: (RPCCallT)[] = [],
@@ -1715,7 +1746,7 @@
  * Symbols declared within a file may be recovered by iterating over all
  * symbols and examining the `declaration_file` field.
  */
-export class SchemaFile {
+export class SchemaFile implements flatbuffers.IUnpackableObject<SchemaFileT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):SchemaFile {
@@ -1802,18 +1833,18 @@
 unpack(): SchemaFileT {
   return new SchemaFileT(
     this.filename(),
-    this.bb!.createScalarList(this.includedFilenames.bind(this), this.includedFilenamesLength())
+    this.bb!.createScalarList<string>(this.includedFilenames.bind(this), this.includedFilenamesLength())
   );
 }
 
 
 unpackTo(_o: SchemaFileT): void {
   _o.filename = this.filename();
-  _o.includedFilenames = this.bb!.createScalarList(this.includedFilenames.bind(this), this.includedFilenamesLength());
+  _o.includedFilenames = this.bb!.createScalarList<string>(this.includedFilenames.bind(this), this.includedFilenamesLength());
 }
 }
 
-export class SchemaFileT {
+export class SchemaFileT implements flatbuffers.IGeneratedObject {
 constructor(
   public filename: string|Uint8Array|null = null,
   public includedFilenames: (string)[] = []
@@ -1831,7 +1862,7 @@
 }
 }
 
-export class Schema {
+export class Schema implements flatbuffers.IUnpackableObject<SchemaT> {
   bb: flatbuffers.ByteBuffer|null = null;
   bb_pos = 0;
   __init(i:number, bb:flatbuffers.ByteBuffer):Schema {
@@ -2038,31 +2069,31 @@
 
 unpack(): SchemaT {
   return new SchemaT(
-    this.bb!.createObjList(this.objects.bind(this), this.objectsLength()),
-    this.bb!.createObjList(this.enums.bind(this), this.enumsLength()),
+    this.bb!.createObjList<Object_, Object_T>(this.objects.bind(this), this.objectsLength()),
+    this.bb!.createObjList<Enum, EnumT>(this.enums.bind(this), this.enumsLength()),
     this.fileIdent(),
     this.fileExt(),
     (this.rootTable() !== null ? this.rootTable()!.unpack() : null),
-    this.bb!.createObjList(this.services.bind(this), this.servicesLength()),
+    this.bb!.createObjList<Service, ServiceT>(this.services.bind(this), this.servicesLength()),
     this.advancedFeatures(),
-    this.bb!.createObjList(this.fbsFiles.bind(this), this.fbsFilesLength())
+    this.bb!.createObjList<SchemaFile, SchemaFileT>(this.fbsFiles.bind(this), this.fbsFilesLength())
   );
 }
 
 
 unpackTo(_o: SchemaT): void {
-  _o.objects = this.bb!.createObjList(this.objects.bind(this), this.objectsLength());
-  _o.enums = this.bb!.createObjList(this.enums.bind(this), this.enumsLength());
+  _o.objects = this.bb!.createObjList<Object_, Object_T>(this.objects.bind(this), this.objectsLength());
+  _o.enums = this.bb!.createObjList<Enum, EnumT>(this.enums.bind(this), this.enumsLength());
   _o.fileIdent = this.fileIdent();
   _o.fileExt = this.fileExt();
   _o.rootTable = (this.rootTable() !== null ? this.rootTable()!.unpack() : null);
-  _o.services = this.bb!.createObjList(this.services.bind(this), this.servicesLength());
+  _o.services = this.bb!.createObjList<Service, ServiceT>(this.services.bind(this), this.servicesLength());
   _o.advancedFeatures = this.advancedFeatures();
-  _o.fbsFiles = this.bb!.createObjList(this.fbsFiles.bind(this), this.fbsFilesLength());
+  _o.fbsFiles = this.bb!.createObjList<SchemaFile, SchemaFileT>(this.fbsFiles.bind(this), this.fbsFilesLength());
 }
 }
 
-export class SchemaT {
+export class SchemaT implements flatbuffers.IGeneratedObject {
 constructor(
   public objects: (Object_T)[] = [],
   public enums: (EnumT)[] = [],