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 <[email protected]>
  • Loading branch information
gbaraldi and Jameson Nash authored Sep 16, 2024
1 parent 55c40ce commit 753296e
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 @@ -831,6 +831,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 @@ -6141,3 +6141,14 @@ end == TypeError
@test Base.infer_exception_type((Vector{Any},)) do args
Core.throw_methoderror(args...)
end == Union{MethodError,ArgumentError}

# 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 753296e

Please sign in to comment.