Skip to content

Commit 213d3be

Browse files
authored
[Variant] List and object builders have no effect until finalized (#7865)
# Which issue does this PR close? - Closes #7863 - Closes #7798 # Rationale for this change Reviews and testing on #7843 exposed the fact that creating a variant list or object builder has side effects that leave the parent in an inconsistent/invalid state if the child builder is never finalized. Rework the finalization logic to be more direct so that child builders have no effect on their parents before their `finish` method is called. # What changes are included in this PR? * Define a new `ParentState` enum that tracks the necessary information for a child to fully finalize its parent. * Remove the `pending` machinery from builders # Are these changes tested? Existing unit tests mostly cover this change. Added new tests to verify that failing to call `finish` leaves the parent unmodified. # Are there any user-facing changes? No.
1 parent c26d154 commit 213d3be

File tree

4 files changed

+479
-146
lines changed

4 files changed

+479
-146
lines changed

0 commit comments

Comments
 (0)