diff --git a/protobuf-bitfun/src/google/protobuf/any_pb.ets b/protobuf-bitfun/src/google/protobuf/any_pb.ets index b1fff4ff8641d9d57526fac42374416f04b1d293..9559fdcebab0a4ca8cced05cbc63d40d278d0537 100644 --- a/protobuf-bitfun/src/google/protobuf/any_pb.ets +++ b/protobuf-bitfun/src/google/protobuf/any_pb.ets @@ -12,6 +12,10 @@ import { IMessageTypeRegistry } from '../../type-registry'; import collections from '@arkts.collections'; +{ + let _ = new collections.Array(); +} + @Sendable export class Any extends Message { /** diff --git a/protobuf-bitfun/src/google/protobuf/duration_pb.ets b/protobuf-bitfun/src/google/protobuf/duration_pb.ets index 24d1a05a78a8b91200d6eb85a43e66e211fa11d9..90d2303a180bcfccc29047f7baae62636292db2e 100644 --- a/protobuf-bitfun/src/google/protobuf/duration_pb.ets +++ b/protobuf-bitfun/src/google/protobuf/duration_pb.ets @@ -12,6 +12,10 @@ import { ProtoRuntime } from '../../private/proto-runtime'; import collections from "@arkts.collections"; +{ + let _ = new collections.Array(); +} + @Sendable export class Duration extends Message { /** diff --git a/protobuf-bitfun/src/google/protobuf/empty_pb.ets b/protobuf-bitfun/src/google/protobuf/empty_pb.ets index 6be3990375b70c04cd76de58fe5d7d959bb7dd02..82dc98edb6ac4ee4806d8b6d4fd89944302ea01c 100644 --- a/protobuf-bitfun/src/google/protobuf/empty_pb.ets +++ b/protobuf-bitfun/src/google/protobuf/empty_pb.ets @@ -11,6 +11,10 @@ import { ProtoRuntime } from '../../private/proto-runtime'; import collections from "@arkts.collections"; +{ + let _ = new collections.Array(); +} + @Sendable export class Empty extends Message { constructor() { diff --git a/protobuf-bitfun/src/google/protobuf/timestamp_pb.ets b/protobuf-bitfun/src/google/protobuf/timestamp_pb.ets index e20242e237c8f206ff11478edadc42043dfab352..c1a223f0a6ad8a16229cfa7a8c79b6ded05a8643 100644 --- a/protobuf-bitfun/src/google/protobuf/timestamp_pb.ets +++ b/protobuf-bitfun/src/google/protobuf/timestamp_pb.ets @@ -6,6 +6,10 @@ import { FieldWrapper } from '../../private/field-wrapper'; import { collections } from '@kit.ArkTS' import { ProtoRuntime } from '../../private/proto-runtime'; +{ + let _ = new collections.Array(); +} + @Sendable export class Timestamp extends Message { /** diff --git a/protobuf-bitfun/src/google/protobuf/wrappers_pb.ets b/protobuf-bitfun/src/google/protobuf/wrappers_pb.ets index ae9489ea97ad3062aed947150cb2b27aa27af555..ada647c83f0fb818995a7f0a2edcf9bce9e67cd6 100644 --- a/protobuf-bitfun/src/google/protobuf/wrappers_pb.ets +++ b/protobuf-bitfun/src/google/protobuf/wrappers_pb.ets @@ -12,6 +12,10 @@ import { protoInt64 } from '../../proto-int64'; import collections from '@arkts.collections'; +{ + let _ = new collections.Array(); +} + @Sendable export class DoubleValue extends Message { /** diff --git a/protobuf-ets-main/protoc-gen-ets/src/typescript.ts b/protobuf-ets-main/protoc-gen-ets/src/typescript.ts index 45e03223d17b559e311f7aaad19fe600e7b56211..4e941f8cb1ebfa7ea352735cb6bc6303185a050b 100644 --- a/protobuf-ets-main/protoc-gen-ets/src/typescript.ts +++ b/protobuf-ets-main/protoc-gen-ets/src/typescript.ts @@ -50,6 +50,10 @@ export function generateEts(schema: Schema) { const f = schema.generateFile(file.name + "_pb.ts"); f.print(`import collections from "@arkts.collections"`) f.print(); + f.print('{'); + f.print(' let _ = new collections.Array();'); + f.print('}'); + f.print(); for (const enumeration of file.enums) { generateEnum(schema, f, enumeration); }