JuliaLang/julia
Vedi su GitHubUnexpected behavior due to implicit `convert` with `Char` and `Integer`
Open
#44.410 aperta il 2 mar 2022
good first issuestrings
Metriche repository
- Star
- (48.709 star)
- Metriche merge PR
- (Merge medio 20g 6h) (157 PR mergiate in 30 g)
Descrizione
julia> append!([1, 2, 3], "4")
4-element Vector{Int64}:
1
2
3
52
is unintuitive (I would expect an error).
I think the mechanism for this is that it treats the "4" as a collection of Chars, and converts them into integers.
cc @jakobnissen @andrewrosemberg @raphaelsaavedra