You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/getsetall.jl
+13-25Lines changed: 13 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ setall(obj, o, vs) = set(obj, o, only(vs))
43
43
# Instead, we need to generate unrolled code explicitly.
44
44
functiongetall(obj, optic::ComposedFunction)
45
45
N =length(decompose(optic))
46
-
_GetAll{N}()(obj, optic)
46
+
_getall(obj, optic, Val(N))
47
47
end
48
48
49
49
functionsetall(obj, optic::ComposedFunction, vs)
@@ -53,8 +53,8 @@ function setall(obj, optic::ComposedFunction, vs)
53
53
end
54
54
55
55
56
-
struct _GetAll{N}end
57
-
(::_GetAll{N})(_)where {N} =error("Too many chained optics: $N is not supported for now. See also https://github.com/JuliaObjects/Accessors.jl/pull/64.")
56
+
_getall(_, _, ::Val{N}) where {N} =error("Too many chained optics: $N is not supported for now. See also https://github.com/JuliaObjects/Accessors.jl/pull/64.")
57
+
_setall(_, _, _, ::Val{N}) where {N} =error("Too many chained optics: $N is not supported for now. See also https://github.com/JuliaObjects/Accessors.jl/pull/68.")
58
58
59
59
_concat(a::Tuple, b::Tuple) = (a..., b...)
60
60
_concat(a::Tuple, b::AbstractVector) =vcat(collect(a), b)
0 commit comments