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

Define VersionNumber(::VersionNumber) #816

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Compat"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.11.0"
version = "4.12.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ changes in `julia`.

* `pkgversion(m::Module)` returns the version of the package that loaded a given module ([#45607]) (since Compat 4.11)

* `VersionNumber(::VersionNumber)` defined as a no-op constructor ([#45052]) (since Compat 4.12)

## Developer tips

One of the most important rules for `Compat.jl` is to avoid breaking user code
Expand Down Expand Up @@ -172,6 +174,7 @@ Note that you should specify the correct minimum version for `Compat` in the
[#43334]: https://github.com/JuliaLang/julia/issues/43334
[#43354]: https://github.com/JuliaLang/julia/issues/43354
[#43852]: https://github.com/JuliaLang/julia/issues/43852
[#45052]: https://github.com/JuliaLang/julia/issues/45052
[#45607]: https://github.com/JuliaLang/julia/issues/45607
[#46104]: https://github.com/JuliaLang/julia/issues/46104
[#48038]: https://github.com/JuliaLang/julia/issues/48038
Expand Down
5 changes: 5 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,11 @@ if VERSION < v"1.7.0-DEV.1187"
export redirect_stdio
end

# https://github.com/JuliaLang/julia/pull/45052
if VERSION < v"1.9.0-DEV.461"
Base.VersionNumber(v::VersionNumber) = v
end

include("deprecated.jl")

end # module Compat
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -728,3 +728,9 @@ end
@test_throws LoadError @eval @compat public @bar foo
@test_throws LoadError @eval @compat publac @bar, foo
end

# https://github.com/JuliaLang/julia/pull/45052
@testset "VersionNumber no-op constructor" begin
v = VersionNumber("1.2.3")
@test VersionNumber(v) === v
end
Loading