diff --git a/src/main.ts b/src/main.ts index 0627979ed..7ab33601f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1403,7 +1403,7 @@ function generateEncode(ctx: Context, fullName: string, messageDesc: DescriptorP writer.ldelim(); `; - if (options.forceLong === LongOption.BIGINT) { + if (isLong(field) && options.forceLong === LongOption.BIGINT) { const fieldType = toReaderCall(field); switch (fieldType) { case 'int64': case 'sint64': case 'sfixed64':