Skip to content

[Variant] Document and test validation of malformed shredded object fields #10619

Closed

Description

@sdf-jkl

Is your feature request related to a problem or challenge?

When variant_get finds a named field in a shredded object, that field must be a Struct containing the shredded value/typed_value representation.

The current code returns InvalidArgumentError when it is not a Struct, but a TODO questions whether traversal should instead fall back to the encoded Variant value.

This extraction point is a valid lazy-validation boundary: a present non-Struct field violates the physical shredding layout.

Describe the solution you'd like

Preserve InvalidArgumentError, replace the TODO with an explanation of the physical invariant, include the field name and actual type in the error, and add a malformed-layout regression test.

Additional context

Activity

  1. cakeni commented on Aug 11, 2026

    @cakeni
    Contributor

    I'd like to work on this. I plan to preserve the validation error, improve its context, and add a malformed-layout regression test.

  2. cakeni commented on Aug 11, 2026

    @cakeni
    Contributor

    take

  3. added a commit that references this issue on Aug 19, 2026
    498e41a
  4. added 3 commits that reference this issue on Aug 26, 2026
    e1c1b19
    af5c8df
    28eb723
  5. added 3 commits that reference this issue on Sep 18, 2026
    10de470
    adedf6f
    94083e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions