Skip to content

Conversation

@emcfarlane
Copy link
Contributor

This fixes a panic on an invalid file where the rpc method has an empty request or response type.

@emcfarlane emcfarlane requested a review from doriable January 5, 2026 23:19
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJan 6, 2026, 2:14 PM

def: output.AST(), // Only messages can be method inputs and outputs
fullName: output.FullName(),
},
if astOutputs := irSymbol.AsMethod().AST().AsMethod().Signature.Outputs(); !astOutputs.IsZero() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should actually be a check on astOutputs.Len() > 0, since all AST accessors already have zero value checks on them (e.g. https://github.com/bufbuild/protocompile/blob/4d8d90b1c6b81a3d7cbd55df836c33b55d0c88c6/experimental/ast/type_generic.go#L147)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert == 1.

@emcfarlane emcfarlane requested a review from doriable January 6, 2026 14:17
@emcfarlane emcfarlane merged commit db5725b into main Jan 6, 2026
10 checks passed
@emcfarlane emcfarlane deleted the ed/fixZeroIRSymbolResolve branch January 6, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants