widen join(::Any...)
return type to AbstractString
#56132
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.
@JeffBezanson and @vtjnash have mentioned that we might want to generalize
join / *
to be more like our binary operators over numbers. In particular, that would mean dynamically choosing a result AbstractString that can "faithfully" encode the concatenation of all provided sub-strings.That means significantly weakening the result type for
join(...)
from::Union{String,AnnotatedString}
to::AbstractString
. This PR takes that inference hit early, without changing howjoin
actually works.This also happens to resolve some of the invalidation problems with StyledStrings.
We'll need more fixes though, because #56005 unfortunately means that StyledStrings invalidates itself (and its dependencies) when
require_stdlib
gets involved