@@ -2313,12 +2313,6 @@ let 𝕃ᵢ = InferenceLattice(MustAliasesLattice(BaseInferenceLattice.instance)
23132313 @test ifelse_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Int), Int, Int) === Union{}
23142314end
23152315
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-
23222316maybeget_mustalias_tmerge (x:: AliasableField ) = x. f
23232317maybeget_mustalias_tmerge (x) = x
23242318@test Base. return_types ((Union{Nothing,AliasableField{Any}},); interp= MustAliasInterpreter ()) do x
@@ -2593,6 +2587,19 @@ end |> only === Compiler.InterMustAlias
25932587 return 0
25942588end == Integer
25952589
2590+ # `isdefined` accuracy for `MustAlias`
2591+ @test Base. infer_return_type ((Any,); interp= MustAliasInterpreter ()) do x
2592+ xx = Ref {Any} (x)
2593+ xxx = Some {Any} (xx)
2594+ Val (isdefined (xxx. value, :x ))
2595+ end == Val{true }
2596+
2597+ @testset " issue #56913: `BoundsError` in type inference" begin
2598+ R = UnitRange{Int}
2599+ @test Type{AbstractVector} == Base. infer_return_type (Base. promote_typeof, Tuple{R, R, Vector{Any}, Vararg{R}})
2600+ @test Type{AbstractVector} == Base. infer_return_type (Base. promote_typeof, Tuple{R, R, Vector{Any}, R, Vararg{R}})
2601+ end
2602+
25962603function f25579 (g)
25972604 h = g[]
25982605 t = (h === nothing )
0 commit comments