diff --git a/pkg/JuliaInterface/tst/convert.tst b/pkg/JuliaInterface/tst/convert.tst index 0d5b9a005..6deea470a 100644 --- a/pkg/JuliaInterface/tst/convert.tst +++ b/pkg/JuliaInterface/tst/convert.tst @@ -169,7 +169,7 @@ gap> ForAll([0..64], n -> Julia.GAP.Obj( -big2^n ) = -2^n); true # -gap> string := GAPToJulia( Julia.Base.AbstractString, "bla" ); +gap> string := GAPToJulia( Julia.Base.String, "bla" ); gap> JuliaToGAP( IsString, string ); "bla" @@ -221,7 +221,7 @@ Error, must be a Julia range ## empty list vs. empty string gap> emptylist:= GAPToJulia( JuliaEvalString( "Vector{Any}"), [] ); -gap> emptystring:= GAPToJulia( Julia.Base.AbstractString, "" ); +gap> emptystring:= GAPToJulia( Julia.Base.String, "" ); gap> JuliaToGAP( IsList, emptylist ); [ ] diff --git a/src/constructors.jl b/src/constructors.jl index 3e54b9570..ca75ebcd0 100644 --- a/src/constructors.jl +++ b/src/constructors.jl @@ -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) diff --git a/src/gap_to_julia.jl b/src/gap_to_julia.jl index d3eab21f4..3f9b4eba8 100644 --- a/src/gap_to_julia.jl +++ b/src/gap_to_julia.jl @@ -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) @@ -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'. diff --git a/test/Aqua.jl b/test/Aqua.jl index 2f1d4aedb..b7f56d767 100644 --- a/test/Aqua.jl +++ b/test/Aqua.jl @@ -3,7 +3,7 @@ using Aqua @testset "Aqua.jl" begin Aqua.test_all( GAP; - ambiguities=false, # TODO: fix ambiguities + ambiguities=true, unbound_args=true, undefined_exports=true, project_extras=true, diff --git a/test/basics.jl b/test/basics.jl index 2e872d1ac..19fdcfb87 100644 --- a/test/basics.jl +++ b/test/basics.jl @@ -53,7 +53,7 @@ end @test_throws ErrorException GAP.Globals.FOOBARQUX - str = GAP.gap_to_julia(AbstractString, GAP.ValueGlobalVariable("IdentifierLetters")) + str = GAP.gap_to_julia(String, GAP.ValueGlobalVariable("IdentifierLetters")) @test str == "0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz" @test GAP.CanAssignGlobalVariable("Read") == false diff --git a/test/constructors.jl b/test/constructors.jl index c442d19e5..8ba7ff088 100644 --- a/test/constructors.jl +++ b/test/constructors.jl @@ -77,14 +77,13 @@ @test (@inferred String(x)) == "abc" x = GAP.evalstr("\"foo\"") @test (@inferred String(x)) == "foo" - @test AbstractString(x) == "foo" end @testset "Symbols" begin x = GAP.evalstr("\"foo\"") @test (@inferred Symbol(x)) == :foo x = GAP.evalstr("(1,2,3)") - @test_throws GAP.ConversionError AbstractString(x) + @test_throws GAP.ConversionError String(x) # Convert GAP string to Vector{UInt8} (==Vector{UInt8}) x = GAP.evalstr("\"foo\"") diff --git a/test/conversion.jl b/test/conversion.jl index a9c39ccd1..a8f78f02d 100644 --- a/test/conversion.jl +++ b/test/conversion.jl @@ -90,7 +90,6 @@ @test (@inferred GAP.gap_to_julia(String, x)) == "abc" x = GAP.evalstr("\"foo\"") @test (@inferred GAP.gap_to_julia(String, x)) == "foo" - @test GAP.gap_to_julia(AbstractString, x) == "foo" @test GAP.gap_to_julia(x) == "foo" x = "abc\000def" @test GAP.gap_to_julia(GAP.julia_to_gap(x)) == x @@ -102,7 +101,7 @@ x = GAP.evalstr("\"foo\"") @test (@inferred GAP.gap_to_julia(Symbol, x)) == :foo x = GAP.evalstr("(1,2,3)") - @test_throws GAP.ConversionError GAP.gap_to_julia(AbstractString, x) + @test_throws GAP.ConversionError GAP.gap_to_julia(String, x) # Convert GAP string to Vector{UInt8} (==Vector{UInt8}) x = GAP.evalstr("\"foo\"")