Skip to content

Different promotion behavior on 1.10 vs 1.11 #102

@MilesCranmer

Description

@MilesCranmer

It seems like there's a different behavior in the promotion rules between 1.10 and 1.11. I wasn't sure if this was intentional or not?

On 1.11:

julia> styled"foo" |> typeof
Base.AnnotatedString{String}

julia> "foo" * styled"foo" |> typeof
Base.AnnotatedString{String}

On 1.10:

julia> styled"foo" |> typeof
StyledStrings.AnnotatedStrings.AnnotatedString{String}

julia> "foo" * styled"foo" |> typeof
String

It was causing some type instabilities in my code as I had presumed everything would be an annotated string after concatenating with strings, but on 1.10 it seems that a regular String overpowers the annotations.

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