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

Remove Base.convert methods between AbstractString and Kind #500

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fredrikekre
Copy link
Member

No description provided.

fredrikekre and others added 3 commits September 3, 2024 23:19
This patch removes the method `convert(::Type{String}, ::Kind)` used for
converting kinds to strings and replaces it with the already existing
method of `Base.string`. There are two reason for this: i) the method
causes invalidations when loading the package and ii) `convert` is
called implicitly in e.g. constructors and should therefore typically
only be defined between similar enough types.
This patch removes the method `Base.convert(::Type{Kind}, ::AbstractString)`
and replaces it with a `Kind(::AbstractString)` constructor. The reason
for this is that `convert` is called implicitly in e.g. constructors and
should therefore typically only be defined between similar enough types.
@LilithHafner
Copy link
Member

This seems worth doing to me. converting between Kind and String is too permissive

julia> push!(["a"], K"=")
2-element Vector{String}:
 "a"
 "="

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

Successfully merging this pull request may close these issues.

2 participants