Skip to content

Nested tuple construction hangs forever in 1.10 and earlier #56052

Open
@luchr

Description

@luchr

Take the following test file nestedtuples.jl:

function please_return()
  tup = ()
  for _ in 1:2
    tup = (tup, ())
  end
  return tup
end

@show please_return()

The function please_return does not terminate (julia hangs forever) for version 1.10.5. It does terminate and returns the expected result in version 1.11.0 though.

Output:

julia> versioninfo()
Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × 12th Gen Intel(R) Core(TM) i5-1240P
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)

julia> include("./nestedtuples.jl")

<<<hangs forever>>>

For comparison the output of 1.11:

julia> versioninfo()
Julia Version 1.11.0
Commit 501a4f25c2b (2024-10-07 11:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × 12th Gen Intel(R) Core(TM) i5-1240P
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)


julia> include("./nestedtuples.jl")
please_return() = (((), ()), ())
(((), ()), ())

Is this a known bug/feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inference

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions