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

RepString("",1) throws in show #19564

Closed
stevengj opened this issue Dec 12, 2016 · 7 comments
Closed

RepString("",1) throws in show #19564

stevengj opened this issue Dec 12, 2016 · 7 comments
Labels
bug Indicates an unexpected problem or unintended behavior strings "Strings!"

Comments

@stevengj
Copy link
Member

julia> RepString("",1)
"Error showing value of type RepString:
ERROR: BoundsError: attempt to access 0-element Array{UInt8,1} at index [0]
 in next(::String, ::Int64) at ./strings/string.jl:88
 in next(::String, ::Int64) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 in escape_string(::IOContext{Base.Terminals.TTYTerminal}, ::RepString, ::String) at ./strings/io.jl:139
 in print_quoted at ./strings/io.jl:158 [inlined]
 in show at ./strings/io.jl:72 [inlined]
 in show at ./replutil.jl:4 [inlined]
 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::RepString) at ./REPL.jl:132
...

I noticed this when testing out #19548. (Bug appears to be in all Julia versions since at least 0.3.)

@stevengj stevengj added bug Indicates an unexpected problem or unintended behavior strings "Strings!" labels Dec 12, 2016
@stevengj
Copy link
Member Author

stevengj commented Dec 12, 2016

(I don't know why we have this type at all. I can't find a single package that uses it explicitly, nor do we use it in Base except for s^n when s is a non-String string. When is efficient handling of repeated strings important?)

@ararslan
Copy link
Member

@StefanKarpinski had mentioned merging SubString with String. Perhaps RepString (and maybe even RevString) could be merged with String as well?

@StefanKarpinski
Copy link
Member

RepString should just be deleted and moved into LegacyStrings.

@StefanKarpinski
Copy link
Member

SubString we still need until we improve the performance of String.

@ararslan
Copy link
Member

Should RevString go as well?

@StefanKarpinski
Copy link
Member

Yes, very likely.

@KristofferC
Copy link
Member

Moved to JuliaStrings/LegacyStrings.jl#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior strings "Strings!"
Projects
None yet
Development

No branches or pull requests

4 participants