Skip to content

Commit

Permalink
Improve type stability for tryparse VersionNumber (#40557)
Browse files Browse the repository at this point in the history
Co-authored-by: Simeon Schaub <[email protected]>
  • Loading branch information
rikhuijzer and simeonschaub authored Apr 22, 2021
1 parent 50400fb commit 1fbb536
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ end

function tryparse(::Type{VersionNumber}, v::AbstractString)
v == "" && return typemax(VersionNumber)
m = match(VERSION_REGEX, v)
m = match(VERSION_REGEX, String(v)::String)
m === nothing && return nothing
major, minor, patch, minus, prerl, plus, build = m.captures
major = parse(VInt, major::AbstractString)
Expand Down

0 comments on commit 1fbb536

Please sign in to comment.