Skip to content

Commit 1fbb536

Browse files
Improve type stability for tryparse VersionNumber (#40557)
Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com>
1 parent 50400fb commit 1fbb536

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/version.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ end
107107

108108
function tryparse(::Type{VersionNumber}, v::AbstractString)
109109
v == "" && return typemax(VersionNumber)
110-
m = match(VERSION_REGEX, v)
110+
m = match(VERSION_REGEX, String(v)::String)
111111
m === nothing && return nothing
112112
major, minor, patch, minus, prerl, plus, build = m.captures
113113
major = parse(VInt, major::AbstractString)

0 commit comments

Comments
 (0)