@@ -126,8 +126,8 @@ Base.promote_op(::typeof(LinearAlgebra.matprod),::Type{NN},::Type{Fun{S,T,VT}})
126126zero (:: Type{Fun} ) = Fun (0. )
127127zero (:: Type{Fun{S,T,VT}} ) where {T,S<: Space ,VT} = zeros (T,S (AnyDomain ()))
128128one (:: Type{Fun{S,T,VT}} ) where {T,S<: Space ,VT} = ones (T,S (AnyDomain ()))
129- zero (f:: Fun{S,T} ) where {S,T} = zeros (T,f . space)
130- one (f:: Fun{S,T} ) where {S,T} = ones (T,f . space)
129+ zero (f:: Fun ) = zeros (cfstype (f), space (f) )
130+ one (f:: Fun ) = ones (cfstype (f), space (f) )
131131
132132cfstype (:: Fun{S,T} ) where {S,T} = T
133133cfstype (:: Type{Fun{S,T,VT}} ) where {S,T,VT} = T
@@ -218,7 +218,7 @@ evaluate(f::Fun,x,y,z...) = evaluate(f.coefficients,f.space,Vec(x,y,z...))
218218dynamic (f:: Fun ) = f # Fun's are already dynamic in that they compile by type
219219
220220for (op,dop) in ((:first ,:leftendpoint ),(:last ,:rightendpoint ))
221- @eval $ op (f:: Fun{S,T} ) where {S,T} = f ($ dop (domain (f)))
221+ @eval $ op (f:: Fun ) = f ($ dop (domain (f)))
222222end
223223
224224
@@ -406,7 +406,7 @@ for (OP,SUM) in ((:(norm),:(sum)),(:linenorm,:linesum))
406406 @eval begin
407407 $ OP (f:: Fun ) = $ OP (f,2 )
408408
409- function $OP (f:: Fun{S} ,p :: Real ) where S <: Space{D,R} where {D,R <: Number }
409+ function $OP (f:: Fun{<:Space{<:Any, <:Number}} , p :: Real )
410410 if p < 1
411411 return error (" p should be 1 ≤ p ≤ ∞" )
412412 elseif 1 ≤ p < Inf
@@ -416,7 +416,7 @@ for (OP,SUM) in ((:(norm),:(sum)),(:linenorm,:linesum))
416416 end
417417 end
418418
419- function $OP (f:: Fun{S} ,p :: Int ) where S <: Space{D,R} where {D,R <: Number }
419+ function $OP (f:: Fun{<:Space{<:Any, <:Number}} , p :: Int )
420420 if 1 ≤ p < Inf
421421 return iseven (p) ? abs ($ SUM (abs2 (f)^ (p÷ 2 )))^ (1 / p) : abs ($ SUM (abs2 (f)^ (p/ 2 )))^ (1 / p)
422422 else
@@ -432,13 +432,13 @@ end
432432transpose (f:: Fun ) = f # default no-op
433433
434434for op = (:real , :imag , :conj )
435- @eval Base.$ op (f:: Fun{S} ) where {S <: RealSpace } = Fun (f. space, ($ op)(f. coefficients))
435+ @eval Base.$ op (f:: Fun{<:RealSpace} ) = Fun (f. space, ($ op)(f. coefficients))
436436end
437437
438438conj (f:: Fun ) = error (" Override conj for $(typeof (f)) " )
439439
440- abs2 (f:: Fun{S,T} ) where {S <: RealSpace ,T <: Real } = f^ 2
441- abs2 (f:: Fun{S,T} ) where {S <: RealSpace ,T <: Complex } = real (f)^ 2 + imag (f)^ 2
440+ abs2 (f:: Fun{<:RealSpace,<:Real} ) = f^ 2
441+ abs2 (f:: Fun{<:RealSpace,<:Complex} ) = real (f)^ 2 + imag (f)^ 2
442442abs2 (f:: Fun )= f* conj (f)
443443
444444# # integration
@@ -478,7 +478,8 @@ Base.rtoldefault(x::Union{T,Type{T}}, y::Union{S,Type{S}}, atol) where {T<:Fun,S
478478 Base. rtoldefault (cfstype (x),cfstype (y), atol)
479479
480480
481- function isapprox (f:: Fun{S1,T} ,g:: Fun{S2,S} ;rtol:: Real = Base. rtoldefault (T,S,0 ), atol:: Real = 0 , norm:: Function = coefficientnorm) where {S1,S2,T,S}
481+ function isapprox (f:: Fun ,g:: Fun ;
482+ rtol:: Real = Base. rtoldefault (cfstype (f),cfstype (g),0 ), atol:: Real = 0 , norm:: Function = coefficientnorm)
482483 if spacescompatible (f,g)
483484 d = norm (f - g)
484485 if isfinite (d)
0 commit comments