Skip to content

Commit

Permalink
Fix hang in tmerge_types_slow (#55757)
Browse files Browse the repository at this point in the history
Fixes #55751

Co-authored-by: Jameson Nash <jameson@juliacomputing.com>
(cherry picked from commit 753296e)
  • Loading branch information
gbaraldi authored and aviatesk committed Sep 17, 2024
1 parent a29fae6 commit 1c516dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/compiler/typelimits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ end
typenames[i] = Any.name
simplify[i] = false
types[j] = widen
typenames[j] = ijname
break
end
end
Expand Down
11 changes: 11 additions & 0 deletions test/compiler/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5671,3 +5671,14 @@ end

# fieldcount on `Tuple` should constant fold, even though `.fields` not const
@test fully_eliminated(Base.fieldcount, Tuple{Type{Tuple{Nothing, Int, Int}}})

# Issue https://github.com/JuliaLang/julia/issues/55751

abstract type AbstractGrid55751{T, N} <: AbstractArray{T, N} end
struct Grid55751{T, N, AT} <: AbstractGrid55751{T, N}
axes::AT
end

t155751 = Union{AbstractArray{UInt8, 4}, Array{Float32, 4}, Grid55751{Float32, 3, _A} where _A}
t255751 = Array{Float32, 3}
@test Core.Compiler.tmerge_types_slow(t155751,t255751) == AbstractArray # shouldn't hang

0 comments on commit 1c516dc

Please sign in to comment.