From 4dcfa9ce8074dfdc75a984a966d74269dc9764cb Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Thu, 1 Aug 2024 17:14:29 +0100 Subject: [PATCH] fix: ensure `Type{F}` always propagated, matching old `Fix1/Fix2` --- base/operators.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/operators.jl b/base/operators.jl index bee2949e4918f3..c24da9719c8d55 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -1170,13 +1170,13 @@ struct Fix{N,F,T} <: Function f::F x::T - function Fix{N}(f::F, x) where {N,F} + function Fix{N}(f::Union{F,Type{F}}, x) where {N,F} if !(N isa Int) throw(ArgumentError(LazyString("expected type parameter in `Fix` to be `Int`, but got `", N, "::", typeof(N), "`"))) elseif N < 1 throw(ArgumentError(LazyString("expected `N` in `Fix{N}` to be integer greater than 0, but got ", N))) end - new{N,_stable_typeof(f),_stable_typeof(x)}(f, x) + new{N,F,_stable_typeof(x)}(f, x) end end