diff --git a/src/base.jl b/src/base.jl index 6bcd8b0..913aaa7 100644 --- a/src/base.jl +++ b/src/base.jl @@ -10,6 +10,10 @@ @functor Base.Fix2 @functor Base.Broadcast.BroadcastFunction +@static if VERSION >= v"1.9" + @functor Base.Splat +end + @static if VERSION >= v"1.7" @functor Base.Returns end diff --git a/test/base.jl b/test/base.jl index 5ac5bea..e06d415 100644 --- a/test/base.jl +++ b/test/base.jl @@ -56,6 +56,12 @@ VERSION >= v"1.7" && @testset "Returns" begin @test Functors.functor(ret)[2]((value = 1:3,)) === Returns(1:3) end +VERSION >= v"1.9" && @testset "Splat" begin + ret = Base.splat(Returns([0, pi, 2pi])) + @test Functors.functor(ret)[1].f.value == [0, pi, 2pi] + @test Functors.functor(ret)[2]((f = sin,)) === Base.splat(sin) +end + @testset "LinearAlgebra containers" begin @test fmapstructure(identity, [1,2,3]') == (parent = [1, 2, 3],) @test fmapstructure(identity, transpose([1,2,3])) == (parent = [1, 2, 3],)