Skip to content

Commit

Permalink
Add default conversion for IO (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer authored May 9, 2022
1 parent 234166b commit a4c7b58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PrecompileSignatures"
uuid = "91cefc8d-f054-46dc-8f8c-26e11d7c5411"
authors = ["Rik Huijzer <[email protected]>"]
version = "3.0.1"
version = "3.0.2"

[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expand Down
5 changes: 4 additions & 1 deletion src/PrecompileSignatures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ end

const SUBMODULES_DEFAULT = true
const SPLIT_UNIONS_DEFAULT = true
const TYPE_CONVERSIONS_DEFAULT = Dict{DataType,DataType}(AbstractString => String)
const TYPE_CONVERSIONS_DEFAULT = Dict{DataType,DataType}(
AbstractString => String,
IO => IOStream
)

"""
Config(
Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ module M
b(x::Any) = x
b(x::Union{Float64,Float32}) = b(x)
c(x::T) where {T<:AbstractString} = x
d(x::IO, y::AbstractString) = x
end

@test P._module_functions(M) == [M.a, M.b, M.c]
@test P._module_functions(M) == [M.a, M.b, M.c, M.d]

@test P._unpack_union!(Union{Float64, Int, String, Symbol}) == [Float64, Int, String, Symbol]

Expand Down Expand Up @@ -78,7 +79,8 @@ sig = Tuple{M.a, Union{String, Number}, Union{Float32, String}}
@test Set(P.precompilables(M)) == Set([
Tuple{typeof(Main.M.a), Int},
Tuple{typeof(Main.M.b), Float64},
Tuple{typeof(Main.M.b), Float32}
Tuple{typeof(Main.M.b), Float32},
Tuple{typeof(Main.M.d), IOStream, String}
])

types = P.precompilables(PlutoRunner)
Expand Down

2 comments on commit a4c7b58

@rikhuijzer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/59969

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.0.2 -m "<description of version>" a4c7b588583235562b2631f92ce9dd27f3bf4acd
git push origin v3.0.2

Please sign in to comment.