@@ -2305,13 +2305,20 @@ let 𝕃ᵢ = InferenceLattice(MustAliasesLattice(BaseInferenceLattice.instance)
23052305 @test tmerge (MustAlias (2 , AliasableField{Any}, 1 , Int), Const (nothing )) === Union{Int,Nothing}
23062306 @test tmerge (Const (nothing ), MustAlias (2 , AliasableField{Any}, 1 , Any)) === Any
23072307 @test tmerge (Const (nothing ), MustAlias (2 , AliasableField{Any}, 1 , Int)) === Union{Int,Nothing}
2308+ tmerge (Const (AbstractVector{<: Any }), Const (AbstractVector{T} where {T})) # issue #56913
23082309 @test isa_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Bool), Const (Bool)) === Const (true )
23092310 @test isa_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Bool), Type{Bool}) === Const (true )
23102311 @test isa_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Int), Type{Bool}) === Const (false )
23112312 @test ifelse_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Bool), Int, Int) === Int
23122313 @test ifelse_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Int), Int, Int) === Union{}
23132314end
23142315
2316+ @testset " issue #56913: `BoundsError` in type inference" begin
2317+ R = UnitRange{Int}
2318+ @test Type{AbstractVector} == Base. infer_return_type (Base. promote_typeof, Tuple{R, R, Vector{Any}, Vararg{R}})
2319+ @test Type{AbstractVector} == Base. infer_return_type (Base. promote_typeof, Tuple{R, R, Vector{Any}, R, Vararg{R}})
2320+ end
2321+
23152322maybeget_mustalias_tmerge (x:: AliasableField ) = x. f
23162323maybeget_mustalias_tmerge (x) = x
23172324@test Base. return_types ((Union{Nothing,AliasableField{Any}},); interp= MustAliasInterpreter ()) do x
0 commit comments