Refactor builder channel and state element API to store errors on the builder.#4557
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
Refactor builder channel and state element API to store errors on the builder.#4557copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_945967740
branch
from
July 11, 2026 00:57
4f167ff to
48fd204
Compare
… builder. Currently, various builder methods like `AddInputChannel`, `AddOutputChannel`, `AddChannel`, and `UnreadStateElement` return `StatusOr<...>` values which require checking using `XLS_ASSIGN_OR_RETURN` or `XLS_ASSERT_OK_AND_ASSIGN`. This change refactors these methods to return wrapper types `BReceiveChannel`, `BSendChannel`, `BChannel`, `BChannelWithInterfaces`, and `BStateElement` and to store any validation failures or errors inside the builder itself (analogous to how `BValue` works). This makes the builder API cleaner and more ergonomic. All tests and translation logic have been updated to match the new API. PiperOrigin-RevId: 945967740
copybara-service
Bot
force-pushed
the
test_945967740
branch
from
July 13, 2026 19:12
48fd204 to
8eab866
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor builder channel and state element API to store errors on the builder.
Currently, various builder methods like
AddInputChannel,AddOutputChannel,AddChannel, andUnreadStateElementreturnStatusOr<...>values which require checking usingXLS_ASSIGN_OR_RETURNorXLS_ASSERT_OK_AND_ASSIGN.This change refactors these methods to return wrapper types
BReceiveChannel,BSendChannel,BChannel,BChannelWithInterfaces, andBStateElementand to store any validation failures or errors inside the builder itself (analogous to howBValueworks). This makes the builder API cleaner and more ergonomic.All tests and translation logic have been updated to match the new API.