Skip to content

Conversation

tecosaur
Copy link
Member

In 6d78a4a we introduced an inference barrier to the various AnnotatedX/StyledStrings methods whose implementations are frustratingly split between Base and a Stdlib, to ease the pain of invalidations.

As has recently been pointed out in the re-opened #57997, this missed a printstyled method. We address that here, together with a tweak to the StyledStrings library in JuliaLang/StyledStrings.jl#124.

In 6d78a4a we introduced an inference barrier to the various
AnnotatedX/StyledStrings methods whose implementations are frustratingly
split between Base and a Stdlib, to ease the pain of invalidations.

As has recently been pointed out in the re-opened JuliaLang#57997, this missed
a `printstyled` method. We address that here, together with a tweak to
the StyledStrings library.

Reported-by: Neven Sajko <[email protected]>
@tecosaur tecosaur added display and printing Aesthetics and correctness of printed representations of objects. stdlib Julia's standard library invalidations labels Sep 18, 2025
@tecosaur
Copy link
Member Author

I've made a push in creating this PR before we get to the weekend because of how much time/attention this has been taking from other people, but it's late for me and I won't be up long enough to test this today. I'll verify that this indeed works as intended in the next day or two.

@tecosaur
Copy link
Member Author

Gah, there seems to be a load order issue with printstyled being provided in show.jl, loaded in line 115 of Base.jl, while the inference barrier functions are loaded by strings/strings.jl, which is loaded in line 108 of show.jl.

@tecosaur
Copy link
Member Author

Adding a function printstyled end declaration just before the inference barrier in strings/annotated_io.jl, this seems to be working without issue.

Is this the best way to resolve the load order issue?

@KristofferC
Copy link
Member

KristofferC commented Sep 22, 2025

Why do these need Base. prefixes at all? They are defined in Base and this is not in a submodule, or?

@tecosaur
Copy link
Member Author

We've put the invalidation barriers in a module AnnotatedDisplay sub-module (line 207).

@KristofferC
Copy link
Member

Ah, ok, then an empty function above should work fine.

@KristofferC KristofferC merged commit 406d37b into JuliaLang:master Sep 23, 2025
5 of 7 checks passed
KristofferC pushed a commit that referenced this pull request Sep 23, 2025
In 6d78a4a we introduced an inference barrier to the various
AnnotatedX/StyledStrings methods whose implementations are frustratingly
split between Base and a Stdlib, to ease the pain of invalidations.

As has recently been pointed out in the re-opened #57997, this missed
a `printstyled` method. We address that here, together with a tweak to
the StyledStrings library.

Reported-by: Neven Sajko <[email protected]>
(cherry picked from commit 406d37b)
xal-0 pushed a commit to xal-0/julia that referenced this pull request Sep 30, 2025
In 6d78a4a we introduced an inference barrier to the various
AnnotatedX/StyledStrings methods whose implementations are frustratingly
split between Base and a Stdlib, to ease the pain of invalidations.

As has recently been pointed out in the re-opened JuliaLang#57997, this missed
a `printstyled` method. We address that here, together with a tweak to
the StyledStrings library.

Reported-by: Neven Sajko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

display and printing Aesthetics and correctness of printed representations of objects. invalidations stdlib Julia's standard library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants