File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,13 +176,12 @@ end
176176
177177# For arrays of numbers, just store one projector:
178178function ProjectTo (x:: AbstractArray{T} ) where {T<: Number }
179- element = T <: Irrational ? ProjectTo {Real} () : ProjectTo (zero (T))
180- if element isa ProjectTo{<: AbstractZero }
181- return ProjectTo {NoTangent} () # short-circuit if all elements project to zero
182- else
183- return ProjectTo {AbstractArray} (; element= element, axes= axes (x))
184- end
179+ return ProjectTo {AbstractArray} (; element= _eltype_projectto (T), axes= axes (x))
185180end
181+ ProjectTo (x:: AbstractArray{Bool} ) = ProjectTo {NoTangent} ()
182+
183+ _eltype_projectto (:: Type{T} ) where {T<: Number } = ProjectTo (zero (T))
184+ _eltype_projectto (:: Type{<:Irrational} ) = ProjectTo {Real} ()
186185
187186# In other cases, store a projector per element:
188187function ProjectTo (xs:: AbstractArray )
You can’t perform that action at this time.
0 commit comments