Skip to content

Stack overflow during type inference #55102

@vchuravy

Description

@vchuravy
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.4 (2024-06-04)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> f(::Val{1000}) = 1000
f (generic function with 1 method)

julia> f(::Val{N}) where N = f(Val(N-1))
f (generic function with 2 methods)

julia> f(Val(2000))
Internal error: stack overflow in type inference of f(Base.Val{2000}).
This might be caused by recursion over very long tuples or argument lists.
1000

In 1.9 this didn't print an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceregression 1.10Regression in the 1.10 releaseregression 1.11Regression in the 1.11 releaseregression 1.12Regression in the 1.12 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions