Skip to content

fix(aco): deserialize nested types inside Option#461

Merged
Lencerf merged 1 commit into
google:mainfrom
Lencerf:fix/aco/option-struct
Jun 14, 2026
Merged

fix(aco): deserialize nested types inside Option#461
Lencerf merged 1 commit into
google:mainfrom
Lencerf:fix/aco/option-struct

Conversation

@Lencerf

@Lencerf Lencerf commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

When deserialize_option constructs a sub-deserializer to parse the Some value, it was inheriting top_level from its parent. For fields inside a struct or map, the parent's top_level is false, causing the sub-deserializer to mistakenly treat its resolved input as a reference ID that needs to be dereferenced.

Fix this by setting top_level to true when creating the sub-deserializer inside deserialize_option. Also add a test case to cover this scenario.

Assisted-by: Antigravity:Gemini-3.5-Flash

When deserialize_option constructs a sub-deserializer to parse
the Some value, it was inheriting top_level from its parent.
For fields inside a struct or map, the parent's top_level is
false, causing the sub-deserializer to mistakenly treat its
resolved input as a reference ID that needs to be dereferenced.

Fix this by setting top_level to true when creating the
sub-deserializer inside deserialize_option. Also add a test
case to cover this scenario.

Assisted-by: Antigravity:Gemini-3.5-Flash
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27508451572

Coverage increased (+0.03%) to 28.684%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 8 of 8 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 14861
Covered Lines: 4153
Line Coverage: 27.95%
Relevant Branches: 1284
Covered Branches: 478
Branch Coverage: 37.23%
Branches in Coverage %: Yes
Coverage Strength: 37.32 hits per line

💛 - Coveralls

@Lencerf Lencerf merged commit d4717d4 into google:main Jun 14, 2026
11 checks passed
@Lencerf Lencerf deleted the fix/aco/option-struct branch June 14, 2026 18:51
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.

2 participants