@@ -2295,13 +2295,20 @@ let 𝕃ᵢ = InferenceLattice(MustAliasesLattice(BaseInferenceLattice.instance)
22952295 @test tmerge (MustAlias (2 , AliasableField{Any}, 1 , Int), Const (nothing )) === Union{Int,Nothing}
22962296 @test tmerge (Const (nothing ), MustAlias (2 , AliasableField{Any}, 1 , Any)) === Any
22972297 @test tmerge (Const (nothing ), MustAlias (2 , AliasableField{Any}, 1 , Int)) === Union{Int,Nothing}
2298+ tmerge (Const (AbstractVector{<: Any }), Const (AbstractVector{T} where {T})) # issue #56913
22982299 @test isa_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Bool), Const (Bool)) === Const (true )
22992300 @test isa_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Bool), Type{Bool}) === Const (true )
23002301 @test isa_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Int), Type{Bool}) === Const (false )
23012302 @test ifelse_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Bool), Int, Int) === Int
23022303 @test ifelse_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Int), Int, Int) === Union{}
23032304end
23042305
2306+ @testset " issue #56913: `BoundsError` in type inference" begin
2307+ R = UnitRange{Int}
2308+ @test Type{AbstractVector} == Base. infer_return_type (Base. promote_typeof, Tuple{R, R, Vector{Any}, Vararg{R}})
2309+ @test Type{AbstractVector} == Base. infer_return_type (Base. promote_typeof, Tuple{R, R, Vector{Any}, R, Vararg{R}})
2310+ end
2311+
23052312maybeget_mustalias_tmerge (x:: AliasableField ) = x. f
23062313maybeget_mustalias_tmerge (x) = x
23072314@test Base. return_types ((Union{Nothing,AliasableField{Any}},); interp= MustAliasInterpreter ()) do x
0 commit comments