Skip to content

Commit

Permalink
fix: ensure Type{F} always propagated, matching old Fix1/Fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Aug 1, 2024
1 parent ed64473 commit 4dcfa9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4dcfa9c

Please sign in to comment.