-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
editions: compiler disallows extension to have default value when file sets default presence to implicit #16664
Comments
Nice, thanks for the thoroughness here Josh :) |
This turned up a related issue: repeated closed enum fields are an error condition when they "inherit" IMPLICIT presence |
Instead of checking the resolved features, we should really be checking the has_presence helper. Repeated fields, oneofs, and extensions can trigger these conditions when they inherit IMPLICIT, even though it's ignored. Closes #16664 PiperOrigin-RevId: 629924397
Instead of checking the resolved features, we should really be checking the has_presence helper. Repeated fields, oneofs, and extensions can trigger these conditions when they inherit IMPLICIT, even though it's ignored. Closes #16664 PiperOrigin-RevId: 629924397
Oh, interesting. I assume the intent is for both of these bugs to be fixed for the v27.0 release? I'll go ahead and test cases to protocompile in the meantime. |
Yep, I'm changing the validation check to use |
Instead of checking the resolved features, we should really be checking the has_presence helper. Repeated fields, oneofs, and extensions can trigger these conditions when they inherit IMPLICIT, even though it's ignored. Closes #16664 PiperOrigin-RevId: 629924397
Instead of checking the resolved features, we should really be checking the has_presence helper. Repeated fields, oneofs, and extensions can trigger these conditions when they inherit IMPLICIT, even though it's ignored. Closes protocolbuffers#16664 PiperOrigin-RevId: 630206208
Instead of checking the resolved features, we should really be checking the has_presence helper. Repeated fields, oneofs, and extensions can trigger these conditions when they inherit IMPLICIT, even though it's ignored. Closes protocolbuffers#16664 PiperOrigin-RevId: 630206208
Extensions always have explicit presence. If an attempt is made to set the
field_presence
feature toIMPLICIT
, 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.The text was updated successfully, but these errors were encountered: