@@ -2313,12 +2313,6 @@ let 𝕃ᵢ = InferenceLattice(MustAliasesLattice(BaseInferenceLattice.instance)
2313
2313
@test ifelse_tfunc (MustAlias (2 , AliasableField{Any}, 1 , Int), Int, Int) === Union{}
2314
2314
end
2315
2315
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
-
2322
2316
maybeget_mustalias_tmerge (x:: AliasableField ) = x. f
2323
2317
maybeget_mustalias_tmerge (x) = x
2324
2318
@test Base. return_types ((Union{Nothing,AliasableField{Any}},); interp= MustAliasInterpreter ()) do x
@@ -2593,6 +2587,19 @@ end |> only === Compiler.InterMustAlias
2593
2587
return 0
2594
2588
end == Integer
2595
2589
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
+
2596
2603
function f25579 (g)
2597
2604
h = g[]
2598
2605
t = (h === nothing )
0 commit comments