Skip to content

Commit

Permalink
Remove (::<AbstractString)(::GapObj)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Sep 13, 2023
1 parent b216185 commit 470bde7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion src/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ function String(obj::GapObj)
Wrappers.IsString(obj) && return CSTR_STRING(Wrappers.CopyToStringRep(obj))
throw(ConversionError(obj, String))
end
(::Type{T})(obj::GapObj) where {T<:AbstractString} = convert(T, String(obj))

"""
Symbol(obj::GapObj)
Expand Down
3 changes: 1 addition & 2 deletions src/gap_to_julia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ gap_to_julia(::Type{Cuchar}, obj::GapObj) = Cuchar(obj)

## Strings
gap_to_julia(::Type{String}, obj::GapObj) = String(obj)
gap_to_julia(::Type{T}, obj::GapObj) where {T<:AbstractString} = T(obj)

## Symbols
gap_to_julia(::Type{Symbol}, obj::GapObj) = Symbol(obj)
Expand Down Expand Up @@ -333,7 +332,7 @@ function gap_to_julia(x::GapObj; recursive::Bool = true)
GAP_IS_MACFLOAT(x) && return gap_to_julia(Float64, x)
GAP_IS_CHAR(x) && return gap_to_julia(Cuchar, x)
# Do not choose this conversion for other lists in 'IsString'.
Wrappers.IsStringRep(x) && return gap_to_julia(AbstractString, x)
Wrappers.IsStringRep(x) && return gap_to_julia(String, x)
# Do not choose this conversion for other lists in 'IsRange'.
Wrappers.IsRangeRep(x) && return gap_to_julia(StepRange{Int64,Int64}, x)
# Do not choose this conversion for other lists in 'IsBlist'.
Expand Down

0 comments on commit 470bde7

Please sign in to comment.