From f3941e1a49259385041df5b286ade152f5f158fb Mon Sep 17 00:00:00 2001 From: ScottPJones Date: Thu, 13 May 2021 12:36:01 -0400 Subject: [PATCH] Fix ambiguity caused by changes to Base --- Project.toml | 2 +- src/core.jl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 85ec0e9..fa7eb82 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,7 @@ keywords = ["Characters"] license = "MIT" desc = "Basic functionality for Chr type" authors = ["ScottPJones "] -version = "1.0.2" +version = "1.0.3" [deps] Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" diff --git a/src/core.jl b/src/core.jl index 5d04faf..1e1ff5a 100644 --- a/src/core.jl +++ b/src/core.jl @@ -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))