diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index 508b7f46dc..bff21695b8 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -14203,6 +14203,11 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, f->full_name, (int)f->type_); } } + } else { + if (syntax == kUpb_Syntax_Editions) { + _upb_DefBuilder_Errf(ctx, "Editions proto cannot lack type for field %s", + f->full_name); + } } if (!has_type && has_type_name) { diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c index 9578e8e976..caa348f73f 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -13696,6 +13696,11 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, f->full_name, (int)f->type_); } } + } else { + if (syntax == kUpb_Syntax_Editions) { + _upb_DefBuilder_Errf(ctx, "Editions proto cannot lack type for field %s", + f->full_name); + } } if (!has_type && has_type_name) {