Extensions always have explicit presence. If an attempt is made to set the field_presence feature to IMPLICIT, the result is an error: "Extensions can't specify field presence".
Unfortunately, if the file default is set to IMPLICIT, protoc is acting as if the extension's field presence inherits this and does not allow setting a default value.
// test.proto
edition = "2023";
option features.field_presence = IMPLICIT;
message Extendee {
extensions 1 to 2;
}
extend Extendee {
uint32 ext_with_default = 1 [default = 123];
}
test.proto:8:10: Implicit presence fields can't specify defaults.