Skip to content

Commit

Permalink
Fix ambiguity caused by changes to Base
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPJones committed May 13, 2021
1 parent 0a436e9 commit f3941e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ keywords = ["Characters"]
license = "MIT"
desc = "Basic functionality for Chr type"
authors = ["ScottPJones <[email protected]>"]
version = "1.0.2"
version = "1.0.3"

[deps]
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
Expand Down
5 changes: 4 additions & 1 deletion src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ rem(x::Chr, ::Type{T}) where {T<:Chr} = (x.v)%T
rem(x::Chr, ::Type{T}) where {T<:Char} = (x.v)%T
rem(x::Chr, ::Type{T}) where {T<:Number} = (x.v)%T

(::Type{S})(v::T) where {S<:Union{UInt32, Int, UInt}, T<:Chr} = codepoint(v)%S
(::Type{UInt32})(v::Chr) = codepoint(v)%UInt32
(::Type{UInt64})(v::Chr) = codepoint(v)%UInt64
(::Type{Int32})(v::Chr) = codepoint(v)%Int32
(::Type{Int64})(v::Chr) = codepoint(v)%Int64
(::Type{Char})(v::Chr) = Char(codepoint(v))
(::Type{T})(v::Char) where {T<:Chr} = T(codepoint(v))

Expand Down

0 comments on commit f3941e1

Please sign in to comment.