Skip to content

Consider adding special Base.promote_typejoin rules for InlineString #14

@bkamins

Description

@bkamins

Following #4 I would propose that instead of:

julia> Base.promote_typejoin(InlineString1, InlineString3)
InlineString

julia> Base.promote_typejoin(InlineString1, String)
AbstractString

we have:

julia> Base.promote_typejoin(InlineString1, InlineString3)
InlineString3

julia> Base.promote_typejoin(InlineString1, String)
String

I know it technically breaks the contract for Base.promote_typejoin but I think in practice in many cases it is an improvement and I do not see scenarios when it would be a problem (given the intended way strings are used - i.e. that in this case type information should be kind of "ignored" in practice and it is better to do the conversion rather than have container having abstract eltype - unless someone explicitly asks for such a container).

CC @nalimilan @quinnj

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions