julia
44b3337f - types: Normalize `Tuple{..., Vararg}` to `Tuple{..., Vararg{Any}}`

Commit
2 days ago
types: Normalize `Tuple{..., Vararg}` to `Tuple{..., Vararg{Any}}` A tuple type ending in a bare `Vararg` (whose `T` is unset) was `==` but not `===` to the same tuple spelled with `Vararg{Any}`, while `egal_types` read an unset `T` as `Any`. So `TypeEgal{A} === TypeEgal{B}` held for `A = Tuple{Any,Vararg}` and `B = Tuple{Any,Vararg{Any}}` even though `A !== B`, and the type cache could hand out a closure type instantiated on one for the other: f(t) = (c -> t <: c) f(Tuple{Any,Vararg{Any}}) f(Tuple{Any,Vararg}) # TypeError: in new, expected Core.TypeEgal{Tuple{Any, Vararg{Any}}}, # got Type{Tuple{Any, Vararg}} Remove the distinction instead: tuple construction replaces a bare `Vararg` parameter with `Vararg{Any}`, as `Tuple` itself already holds, so the two spellings are the same type, and `egal_types` compares `T` as stored. Both spellings print as `Tuple{..., Vararg}`. Co-authored-by: Jameson Nash <vtjnash@gmail.com> Assisted-by: Claude Code (Opus 5.5)
Author
Parents
Loading