@@ -117,7 +117,9 @@ New types should prefer to register their default algorithms in the type domain.
117117""" default_algorithm
118118default_algorithm (f:: F , A; kwargs... ) where {F} = default_algorithm (f, typeof (A); kwargs... )
119119# avoid infinite recursion:
120- default_algorithm (f, T:: Type ; kwargs... ) = throw (MethodError (default_algorithm, (f, T)))
120+ function default_algorithm (f:: F , :: Type{T} ; kwargs... ) where {F,T}
121+ throw (MethodError (default_algorithm, (f, T)))
122+ end
121123
122124@doc """
123125 copy_input(f, A)
@@ -198,10 +200,11 @@ macro functiondef(f)
198200 end
199201
200202 # define fallbacks for algorithm selection
201- @inline function select_algorithm (:: typeof ($ f), A, alg:: Alg ; kwargs... ) where {Alg}
203+ @inline function select_algorithm (:: typeof ($ f), :: Type{A} , alg:: Alg ;
204+ kwargs... ) where {Alg,A}
202205 return select_algorithm ($ f!, A, alg; kwargs... )
203206 end
204- @inline function default_algorithm (:: typeof ($ f), A ; kwargs... )
207+ @inline function default_algorithm (:: typeof ($ f), :: Type{A} ; kwargs... ) where {A}
205208 return default_algorithm ($ f!, A; kwargs... )
206209 end
207210
0 commit comments