Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add array/slice support for reflected values #11

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

jsternberg
Copy link
Owner

This adds support for using AddReflected or AppendReflected with an
array or slice.

It also resolves an issue where using AddReflected would invoke
Elem() on the reflected value which was an illegal usage of this
function and would cause a panic. If it hadn't caused a panic, it would
have likely resulted in an infinite loop anyway.

This also refactors the code slightly so AddReflected and
AppendReflected no longer have duplicate code and AppendReflected is
the primary section of code.

This adds support for using `AddReflected` or `AppendReflected` with an
array or slice.

It also resolves an issue where using `AddReflected` would invoke
`Elem()` on the reflected value which was an illegal usage of this
function and would cause a panic. If it hadn't caused a panic, it would
have likely resulted in an infinite loop anyway.

This also refactors the code slightly so `AddReflected` and
`AppendReflected` no longer have duplicate code and `AppendReflected` is
the primary section of code.
@jsternberg
Copy link
Owner Author

Based off of PR #10. The primary difference is removing the duplicate code between AddReflected and AppendReflected and instead making AppendReflected the primary section of code.

@jsternberg jsternberg merged commit 40d3a60 into master Aug 23, 2022
@jsternberg jsternberg deleted the feat/reflected-array-panic branch August 23, 2022 17:18
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