From 1203f32f17ca31ba637b72012d94d2693373cef7 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 7 Sep 2022 09:00:25 +0200 Subject: [PATCH] remove overload of `Base.tail(t::Tangent{<:NamedTuple{<:Any, <:Tuple{}}})` This fixes many invalidations when loading ChainRulesCore.jl. Fixes #576. --- src/tangent_types/tangent.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tangent_types/tangent.jl b/src/tangent_types/tangent.jl index d13e75c76..150072bcd 100644 --- a/src/tangent_types/tangent.jl +++ b/src/tangent_types/tangent.jl @@ -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))