Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specialised substring equality for annotated strs (#54302)
The least-bad idea I've had so far for fixing #53042. I figure this fixes the bug raised there, and we can always switch to a clearly-better solution if one appears. The fact that only a string without annotations is equal to a non-annotated string (in order to preserve the transitivity of equality), makes the generic fallback methods for string comparison insufficient. As such, ==(::AnnoatedString, ::AbstractString) is implemented in annotated.jl, but this issue re-appears when dealing with substrings. The obvious solution is to just implement a specialised method for substrings. This does seem potentially a bit whack-a-mole, but I'm worried that cleverer solutions might come with subtle issues of their own. For now, let's try the simple and obvious solution, and improve it later if we can work out a nicer way of handling this issue in general.
- Loading branch information