Skip to content

Conversation

@apparentlymart
Copy link
Contributor

This fixes a panic for example.* if example is an unknown value that's marked.

We were calling .Range() on any unknown sourceVal, without first checking whether it was marked. That method panics if called on a marked value, so we need to strip that off first.

While testing this I found some return paths that weren't properly transferring the source value's marks to the output, and so this also addresses those so that all return paths preserve whatever markings are present on the source value.

In particular, if a non-list/set/tuple value gets "upgraded" into a tuple then we must transfer its marks onto the tuple, because the decision about constructing that value was based on characteristics of the source value.

We were calling .Range() on any unknown sourceVal, without first checking
whether it was marked. That method panics if called on a marked value,
so we need to strip that off first.

While testing this I found some return paths that weren't properly
transferring the source value's marks to the output, and so this also
addresses those so that all return paths preserve whatever markings are
present on the source value.

In particular, if a non-list/set/tuple value gets "upgraded" into a tuple
then we must transfer its marks onto the tuple, because the decision about
constructing that value was based on characteristics of the source value.
@apparentlymart apparentlymart requested a review from a team May 9, 2024 01:07
@apparentlymart apparentlymart self-assigned this May 9, 2024
@apparentlymart apparentlymart merged commit bc75765 into main May 9, 2024
@apparentlymart apparentlymart deleted the b-splat-unknown-marked-panic branch May 9, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants