Skip to content

Commit cb36a52

Browse files
mcabbottoxinabox
authored andcommitted
rm ProjectTo{Any} completely
1 parent 869e2a5 commit cb36a52

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/projection.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ julia> ProjectTo([1 2; 3 4]') # no special structure, integers are promoted to
108108
ProjectTo{AbstractArray}(element = ProjectTo{Float64}(), axes = (Base.OneTo(2), Base.OneTo(2)))
109109
```
110110
"""
111-
ProjectTo() = ProjectTo{Any}() # trivial case, exists so that maybe_call(f, x) knows what to do
112-
(x::ProjectTo{Any})(dx) = dx
111+
ProjectTo(::Any) # just to attach docstring
113112

114113
# Generic
115114
(::ProjectTo{T})(dx::T) where {T} = dx # not always correct but we have special cases for when it isn't
@@ -163,8 +162,6 @@ function ProjectTo(xs::AbstractArray)
163162
elements = map(ProjectTo, xs)
164163
if elements isa AbstractArray{<:ProjectTo{<:AbstractZero}}
165164
return ProjectTo{NoTangent}() # short-circuit if all elements project to zero
166-
# elseif elements isa AbstractArray{<:ProjectTo{Any}}
167-
# return ProjectTo{AbstractArray}(; element=ProjectTo(), axes=axes(xs)) # ... or all identity projection
168165
else
169166
# Arrays of arrays come here, and will apply projectors individually:
170167
return ProjectTo{AbstractArray}(; elements=elements, axes=axes(xs))

0 commit comments

Comments
 (0)