Skip to content

OutOfMemoryError for Tuple{Vararg{T, N}} where {T} for large N::Int #57813

@nsajko

Description

@nsajko

I'd expect Julia to be able to handle an UnionAll Vararg like here without trying to expand it. Instead, an OutOfMemoryError is thrown:

julia> struct T{
           N,
           (Tuple{Vararg{T, N}} where {T}) <: Tup <: Tuple,
       }
       end

julia> T{typemax(Int) - 1}
ERROR: OutOfMemoryError()
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1

julia> versioninfo()
Julia Version 1.13.0-DEV.249
Commit bc98abcfbe3 (2025-03-18 05:23 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × AMD Ryzen 3 5300U with Radeon Graphics
  WORD_SIZE: 64
  LLVM: libLLVM-19.1.7 (ORCJIT, znver2)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 8 virtual cores)

Metadata

Metadata

Assignees

No one assigned

    Labels

    types and dispatchTypes, subtyping and method dispatch

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions