Skip to content

reflect: pass StructOf field slice to reflectlite#5266

Open
cuiweixie wants to merge 1 commit intotinygo-org:releasefrom
cuiweixie:reflect/structof-forward-fields
Open

reflect: pass StructOf field slice to reflectlite#5266
cuiweixie wants to merge 1 commit intotinygo-org:releasefrom
cuiweixie:reflect/structof-forward-fields

Conversation

@cuiweixie
Copy link
Copy Markdown

Summary

reflect.StructOf previously discarded its []StructField argument and always called reflectlite.StructOf with an empty slice, so dynamic struct layout never matched the requested fields.

Convert each StructField to reflectlite.StructField (including Type via toRawType), matching how FuncOf forwards its type slices.

Note

reflectlite.StructOf remains unimplemented (panics) until that work lands; this change only fixes the forwarding bug at the reflect wrapper layer.

Testing

Not run (small wrapper fix).

StructOf ignored its argument and always called reflectlite.StructOf
with an empty field list. Convert []StructField to the reflectlite
form so callers' fields are forwarded, consistent with FuncOf.
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.

1 participant