Skip to content

Commit f210a9b

Browse files
rikhuijzersimeonschaub
authored andcommitted
Improve type stability for tryparse VersionNumber (JuliaLang#40557)
Co-authored-by: Simeon Schaub <[email protected]>
1 parent b70a0e1 commit f210a9b

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)