Skip to content

Commit

Permalink
Compat for Serialization stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Jan 28, 2018
1 parent 169abdd commit 5f3025d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ Currently, the `@compat` macro supports the following syntaxes:
* `using Compat.REPL` is provided on versions older than 0.7, where this library is
not yet part of the standard library ([#25544]).

* `using Compat.Serialization` is provided on versions older than 0.7, where this library is
not yet part of the standard library ([#25628]).

## New functions, macros, and methods

* `@views` takes an expression and converts all slices to views ([#20164]), while
Expand Down Expand Up @@ -493,5 +496,6 @@ includes this fix. Find the minimum version from there.
[#25544]: https://github.com/JuliaLang/julia/issues/25544
[#25545]: https://github.com/JuliaLang/julia/issues/25545
[#25571]: https://github.com/JuliaLang/julia/issues/25571
[#25628]: https://github.com/JuliaLang/julia/issues/25628
[#25629]: https://github.com/JuliaLang/julia/issues/25629
[#25654]: https://github.com/JuliaLang/julia/issues/25654
6 changes: 6 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,12 @@ else
import REPL
end

if VERSION < v"0.7.0-DEV.3476"
const Serialization = Base.Serializer
else
import Serialization
end

# 0.7.0-DEV.1993
@static if !isdefined(Base, :EqualTo)
if VERSION >= v"0.6.0"
Expand Down
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,14 @@ module TestREPL
@test isdefined(@__MODULE__, :REPL)
end

# 0.7.0-DEV.3476
module TestSerialization
using Compat
using Compat.Serialization
using Compat.Test
@test isdefined(@__MODULE__, :Serialization)
end

if VERSION < v"0.6.0"
include("deprecated.jl")
end
Expand Down

0 comments on commit 5f3025d

Please sign in to comment.