Skip to content

Commit

Permalink
remove overload of `Base.tail(t::Tangent{<:NamedTuple{<:Any, <:Tuple{…
Browse files Browse the repository at this point in the history
…}}})`

This fixes many invalidations when loading ChainRulesCore.jl. Fixes JuliaDiff#576.
  • Loading branch information
ranocha committed Sep 7, 2022
1 parent 07dfe60 commit 1203f32
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/tangent_types/tangent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ Base.tail(t::Tangent{<:Tuple{}}) = NoTangent()
Base.tail(t::Tangent{P}) where {P<:NamedTuple} = Tangent{_tailtype(P)}(; Base.tail(backing(canonicalize(t)))...)
_tailtype(::Type{NamedTuple{S,P}}) where {S,P} = NamedTuple{Base.tail(S), _tailtype(P)}
Base.tail(t::Tangent{<:NamedTuple{<:Any, <:Tuple{Any}}}) = NoTangent()
Base.tail(t::Tangent{<:NamedTuple{<:Any, <:Tuple{}}}) = NoTangent()

function Base.getindex(tangent::Tangent{P,T}, idx::Int) where {P,T<:Union{Tuple,NamedTuple}}
back = backing(canonicalize(tangent))
Expand Down

0 comments on commit 1203f32

Please sign in to comment.