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

using LegacyString breaks string(::Char) #8

Closed
vtjnash opened this issue Oct 26, 2016 · 1 comment
Closed

using LegacyString breaks string(::Char) #8

vtjnash opened this issue Oct 26, 2016 · 1 comment
Labels

Comments

@vtjnash
Copy link

vtjnash commented Oct 26, 2016

ERROR: MethodError: string(::Char) is ambiguous. Candidates:
  string(a::Union{Char,LegacyStrings.ASCIIString,LegacyStrings.UTF8String}...) at /Users/jameson/.julia/v0.6/LegacyStrings/src/utf8.jl:161
  string(a::Union{Char,String}...) at strings/string.jl:179
@martinholters
Copy link
Contributor

How about just removing string(a::Union{ByteString,Char}...)? IIUC, it's just there for performance sake, and correctness should be more important than performance. An alternative could be to rewrite it as string(a1::ByteString, a::Union{ByteString,Char}...) to keep the same performance at least for cases where the first argument is not a Char. I have no idea whether it is worth it, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants