diff --git a/Project.toml b/Project.toml index 2e616ee2..e568b052 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ArrayInterface" uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.26.0" +version = "7.27.0" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" @@ -14,6 +14,7 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" +FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" Metal = "dde4c033-4e86-420c-a63e-0dd931031962" ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" @@ -29,6 +30,7 @@ ArrayInterfaceCUDAExt = "CUDA" ArrayInterfaceCUDSSExt = ["CUDSS", "CUDA"] ArrayInterfaceChainRulesCoreExt = "ChainRulesCore" ArrayInterfaceChainRulesExt = "ChainRules" +ArrayInterfaceFillArraysExt = "FillArrays" ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" ArrayInterfaceMetalExt = "Metal" ArrayInterfaceReverseDiffExt = "ReverseDiff" @@ -46,6 +48,7 @@ CUDSS = "0.6.1, 0.7, 0.8" ChainRules = "1" ChainRulesCore = "1" ChainRulesTestUtils = "1" +FillArrays = "1" GPUArraysCore = "0.1, 0.2" LinearAlgebra = "1.10" Metal = "1" diff --git a/ext/ArrayInterfaceFillArraysExt.jl b/ext/ArrayInterfaceFillArraysExt.jl new file mode 100644 index 00000000..ba6a30f0 --- /dev/null +++ b/ext/ArrayInterfaceFillArraysExt.jl @@ -0,0 +1,9 @@ +module ArrayInterfaceFillArraysExt + +using ArrayInterface: ArrayInterface +using FillArrays: AbstractFill, OneElement + +ArrayInterface.can_setindex(::Type{<:AbstractFill}) = false +ArrayInterface.can_setindex(::Type{<:OneElement}) = false + +end diff --git a/test/fillarrays.jl b/test/fillarrays.jl new file mode 100644 index 00000000..6b5236b8 --- /dev/null +++ b/test/fillarrays.jl @@ -0,0 +1,11 @@ +using ArrayInterface, FillArrays, Test + +@test !ArrayInterface.can_setindex(Fill(1.0, 3)) +@test !ArrayInterface.can_setindex(typeof(Fill(1.0, 3))) +@test !ArrayInterface.can_setindex(Ones(3)) +@test !ArrayInterface.can_setindex(Zeros(3)) +@test !ArrayInterface.can_setindex(typeof(Zeros(2, 2))) + +oe = OneElement(3.0, 2, 4) +@test !ArrayInterface.can_setindex(oe) +@test !ArrayInterface.can_setindex(typeof(oe)) diff --git a/test/runtests.jl b/test/runtests.jl index cd47c19f..c312622a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -16,6 +16,7 @@ end @time @safetestset "AD Integration" begin include("ad.jl") end @time @safetestset "StaticArrays" begin include("staticarrays.jl") end @time @safetestset "ChainRules" begin include("chainrules.jl") end + @time @safetestset "FillArrays" begin include("fillarrays.jl") end end if GROUP == "GPU"