Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LazyString building with non-ASCII preceding $ #49248

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

Liozou
Copy link
Member

@Liozou Liozou commented Apr 4, 2023

Simple bugfix for building LazyString with an $ sign just after a character of encoding longer than one codeunit.

master:

julia> lazy"foo n°$3"
ERROR: LoadError: StringIndexError: invalid index [7], valid nearby indices [6]=>'°', [8]=>'$'
Stacktrace:
 [1] string_index_err(s::String, i::Int64)
   @ Base ./strings/string.jl:12
 [2] getindex(s::String, r::UnitRange{Int64})
   @ Base ./strings/string.jl:279
 [3] var"@lazy_str"(__source__::LineNumberNode, __module__::Module, text::Any)
   @ Base ./strings/lazy.jl:70
in expression starting at REPL[8]:1

This PR:

julia> lazy"foo n°$3"
"foo n°3"

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Apr 4, 2023
@KristofferC KristofferC added strings "Strings!" bugfix This change fixes an existing bug backport 1.9 Change should be backported to release-1.9 labels Apr 4, 2023
@KristofferC KristofferC merged commit bd1a664 into JuliaLang:master Apr 5, 2023
KristofferC pushed a commit that referenced this pull request Apr 9, 2023
@KristofferC KristofferC mentioned this pull request Apr 9, 2023
26 tasks
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Apr 11, 2023
Xnartharax pushed a commit to Xnartharax/julia that referenced this pull request Apr 19, 2023
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug strings "Strings!"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants