Skip to content

Commit

Permalink
Update deferred?
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Robson committed Nov 10, 2021
1 parent 9926cf0 commit cf662a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ Base.:(==)(a::Deferred, b::Deferred) = (a.f == b.f) && (a.args == b.args)

value(x::Deferred) = x.f(value(x.args)...)

function flatten(::Type{T}, x::Deferred) where {T<:Real}
function flatten(::Type{T}, x::D) where {T<:Real, D<:Deferred}
v, unflatten = flatten(T, x.args)
unflatten_Deferred(v_new::Vector{T}) = Deferred(x.f, unflatten(v_new))
unflatten_Deferred(v_new::Vector{T}) = D(x.f, unflatten(v_new))
return v, unflatten_Deferred
end

Expand Down

0 comments on commit cf662a8

Please sign in to comment.