File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -179,13 +179,12 @@ end
179179
180180# For arrays of numbers, just store one projector:
181181function ProjectTo (x:: AbstractArray{T} ) where {T<: Number }
182- element = T <: Irrational ? ProjectTo {Real} () : ProjectTo (zero (T))
183- if element isa ProjectTo{<: AbstractZero }
184- return ProjectTo {NoTangent} () # short-circuit if all elements project to zero
185- else
186- return ProjectTo {AbstractArray} (; element= element, axes= axes (x))
187- end
182+ return ProjectTo {AbstractArray} (; element= _eltype_projectto (T), axes= axes (x))
188183end
184+ ProjectTo (x:: AbstractArray{Bool} ) = ProjectTo {NoTangent} ()
185+
186+ _eltype_projectto (:: Type{T} ) where {T<: Number } = ProjectTo (zero (T))
187+ _eltype_projectto (:: Type{<:Irrational} ) = ProjectTo {Real} ()
189188
190189# In other cases, store a projector per element:
191190function ProjectTo (xs:: AbstractArray )
You can’t perform that action at this time.
0 commit comments