diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f3c9cc3..036865b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,8 +10,7 @@ jobs: fail-fast: false matrix: version: - - '1.0' - - '1.3' + - '1.6' - '1' - 'nightly' os: diff --git a/Project.toml b/Project.toml index fed7fc4..50f3021 100644 --- a/Project.toml +++ b/Project.toml @@ -1,18 +1,17 @@ name = "Setfield" uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" -version = "1.0.0" +version = "1.1.0" [deps] ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9" Future = "9fa8497b-333b-5362-9e8d-4d0656e87820" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -Requires = "ae029012-a4dd-5104-9daa-d747884805df" +StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" [compat] ConstructionBase = "0.1, 1.0" MacroTools = "0.4.4, 0.5" -Requires = "0.5, 1.0" -julia = "1" +julia = "1.6" [extras] BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" diff --git a/src/Setfield.jl b/src/Setfield.jl index d061cd4..a4c9a29 100644 --- a/src/Setfield.jl +++ b/src/Setfield.jl @@ -2,7 +2,7 @@ __precompile__(true) module Setfield using MacroTools using MacroTools: isstructdef, splitstructdef, postwalk -using Requires: @require +using StaticArraysCore if VERSION < v"1.1-" using Future: copy! @@ -26,12 +26,4 @@ for n in names(Setfield, all=true) @eval Base.show(io::IO, l::$T) = _show(io, nothing, l) end end - -function __init__() - @require StaticArrays="90137ffa-7385-5640-81b9-e52037218182" begin - setindex(a::StaticArrays.StaticArray, args...) = - Base.setindex(a, args...) - end -end - end diff --git a/src/setindex.jl b/src/setindex.jl index 03639d7..5b01d84 100644 --- a/src/setindex.jl +++ b/src/setindex.jl @@ -20,3 +20,6 @@ Base.@propagate_inbounds function setindex(d0::AbstractDict, v, k) d[k] = v return d end + +setindex(a::StaticArraysCore.StaticArray, args...) = + Base.setindex(a, args...)