@@ -646,7 +646,7 @@ func (l *ParseTreeListener) ExitOneof_def(ctx *Oneof_defContext) {
646646
647647// parseCommonTypeField parses a regular field (not embedded) inside a type or oneof.
648648func (l * ParseTreeListener ) parseCommonTypeField (f ICommon_type_fieldContext , typeField * TypeField , t * Type ) {
649- typeField .Type = l .parseCommonFieldType (f .Common_field_type (), t )
649+ typeField .Type = l .parseValueType (f .Value_type (), t )
650650 typeField .Name = f .IDENTIFIER ().GetText ()
651651 typeField .Required = f .KW_REQUIRED () != nil
652652
@@ -796,23 +796,13 @@ func collectValidateFuncs(fieldType string, expr validate.Expr, funcs map[string
796796 }
797797}
798798
799- // parseCommonFieldType distinguishes between built-in, user-defined, or container types.
800- func (l * ParseTreeListener ) parseCommonFieldType (ctx ICommon_field_typeContext , t * Type ) TypeDefinition {
799+ // parseValueType resolves value types inside container types.
800+ func (l * ParseTreeListener ) parseValueType (ctx IValue_typeContext , t * Type ) TypeDefinition {
801+
802+ // Built-in bytes type
801803 if ctx .TYPE_BYTES () != nil {
802804 return BytesType {}
803805 }
804- return l .parseValueType (ctx , t )
805- }
806-
807- // parseValueType resolves value types inside container types.
808- func (l * ParseTreeListener ) parseValueType (ctx interface {
809- GetText () string
810- GetStart () antlr.Token
811- GetStop () antlr.Token
812- Base_type () IBase_typeContext
813- User_type () IUser_typeContext
814- Container_type () IContainer_typeContext
815- }, t * Type ) TypeDefinition {
816806
817807 // Built-in primitive type
818808 if b := ctx .Base_type (); b != nil {
0 commit comments