Skip to content

Commit 34b2ae5

Browse files
authored
return tuple type manipulations to deprecated.jl (#36769)
Some important packages seem to use these.
1 parent 7eecb73 commit 34b2ae5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

base/deprecated.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,13 @@ iterate(match::Core.MethodMatch, field::Int=1) =
221221
getindex(match::Core.MethodMatch, field::Int) =
222222
getfield(match, field)
223223

224+
225+
# these were internal functions, but some packages seem to be relying on them
226+
tuple_type_head(T::Type) = fieldtype(T, 1)
227+
tuple_type_cons(::Type, ::Type{Union{}}) = Union{}
228+
function tuple_type_cons(::Type{S}, ::Type{T}) where T<:Tuple where S
229+
@_pure_meta
230+
Tuple{S, T.parameters...}
231+
end
232+
224233
# END 1.6 deprecations

0 commit comments

Comments
 (0)