Fix list_combine()'s ptype finalization when default is involved
#2100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2094
Basic idea is that when we see this
We need the common type across
!!!xanddefault.We "optimize" the ptype computation in
list_combine()asrather than as
Because this avoids us having to reallocate a possibly very large list just to slip
defaultin there. It also avoids forcingdefault_arg. I'm also not entirely sure how we'd usex_argif we did that.But in this particular
list_combine()example, we getSo we actually need a way to tell
vec_ptype_common()that we'd like to opt out of ptype finalization and promise to do it "manually" later on. Now that we've ensured that:vec_ptype()andvec_ptype2()never finalizevec_ptype_common()always finalizesI think it makes some sense that we should have an internal way to make
vec_ptype_common()act exactly like repeatedvec_ptype2()for cases like this one.