Skip to content

[pigeon] Produce a helpful error for bad method return type#11204

Open
srawlins wants to merge 3 commits intoflutter:mainfrom
srawlins:bad-return-type
Open

[pigeon] Produce a helpful error for bad method return type#11204
srawlins wants to merge 3 commits intoflutter:mainfrom
srawlins:bad-return-type

Conversation

@srawlins
Copy link
Contributor

@srawlins srawlins commented Mar 9, 2026

When we encounter an unexpected (or missing) method return type, we now produce a meaningful error instead of a null-pointer exception.

Fixes flutter/flutter#92639

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1].
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
  • All existing and new tests are passing.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves error handling in Pigeon by providing a more informative error message for methods with unexpected or missing return types, preventing null-pointer exceptions. The changes are accompanied by relevant tests. My review includes a suggestion to fix a typo in a variable name for better code clarity and maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pigeon] missing error message when missing return type

1 participant