@@ -1535,7 +1535,7 @@ let nfields_tfunc(@nospecialize xs...) =
15351535 @test sizeof_nothrow (String)
15361536 @test ! sizeof_nothrow (Type{String})
15371537 @test sizeof_tfunc (Type{Union{Int64, Int32}}) == Const (Core. sizeof (Union{Int64, Int32}))
1538- let PT = Core. PartialStruct (Cpre . Compiler. fallback_lattice, Tuple{Int64,UInt64}, Any[Const (10 ), UInt64])
1538+ let PT = Core. PartialStruct (Base . Compiler. fallback_lattice, Tuple{Int64,UInt64}, Any[Const (10 ), UInt64])
15391539 @test sizeof_tfunc (PT) === Const (16 )
15401540 @test nfields_tfunc (PT) === Const (2 )
15411541 @test sizeof_nothrow (PT)
@@ -3381,9 +3381,9 @@ struct FooPartial
33813381 b:: Int
33823382 c:: Int
33833383end
3384- let PT1 = PartialStruct (FooPartial, Any[Const (1 ), Const (2 ), Int]),
3385- PT2 = PartialStruct (FooPartial, Any[Const (1 ), Int, Int]),
3386- PT3 = PartialStruct (FooPartial, Any[Const (1 ), Int, Const (3 )])
3384+ let PT1 = PartialStruct (Base . Compiler . fallback_lattice, FooPartial, Any[Const (1 ), Const (2 ), Int]),
3385+ PT2 = PartialStruct (Base . Compiler . fallback_lattice, FooPartial, Any[Const (1 ), Int, Int]),
3386+ PT3 = PartialStruct (Base . Compiler . fallback_lattice, FooPartial, Any[Const (1 ), Int, Const (3 )])
33873387
33883388 @test PT1 ⊑ PT2
33893389 @test ! (PT1 ⊑ PT3) && ! (PT2 ⊑ PT1)
@@ -4635,67 +4635,67 @@ end
46354635@testset " issue #43784" begin
46364636 ⊑ = Core. Compiler. partialorder (Core. Compiler. fallback_lattice)
46374637 ⊔ = Core. Compiler. join (Core. Compiler. fallback_lattice)
4638+ 𝕃 = Core. Compiler. fallback_lattice
46384639 Const, PartialStruct = Core. Const, Core. PartialStruct
4639-
46404640 let init = Base. ImmutableDict {Any,Any} ()
46414641 a = Const (init)
4642- b = PartialStruct (typeof (init), Any[Const (init), Any, Any])
4642+ b = PartialStruct (𝕃, typeof (init), Any[Const (init), Any, Any])
46434643 c = a ⊔ b
46444644 @test a ⊑ c && b ⊑ c
46454645 @test c === typeof (init)
46464646 end
46474647 let init = Base. ImmutableDict {Any,Any} (1 ,2 )
46484648 a = Const (init)
4649- b = PartialStruct (typeof (init), Any[Const (getfield (init,1 )), Any, Any])
4649+ b = PartialStruct (𝕃, typeof (init), Any[Const (getfield (init,1 )), Any, Any])
46504650 c = a ⊔ b
46514651 @test a ⊑ c && b ⊑ c
46524652 @test c isa PartialStruct
46534653 @test length (c. fields) == 3
46544654 end
46554655 let init = Base. ImmutableDict {Number,Number} ()
46564656 a = Const (init)
4657- b = PartialStruct (typeof (init), Any[Const (init), Number, ComplexF64])
4657+ b = PartialStruct (𝕃, typeof (init), Any[Const (init), Number, ComplexF64])
46584658 c = a ⊔ b
46594659 @test a ⊑ c && b ⊑ c
46604660 @test c === typeof (init)
46614661 end
46624662 let init = Base. ImmutableDict {Number,Number} ()
4663- a = PartialStruct (typeof (init), Any[Const (init), ComplexF64, ComplexF64])
4664- b = PartialStruct (typeof (init), Any[Const (init), Number, ComplexF64])
4663+ a = PartialStruct (𝕃, typeof (init), Any[Const (init), ComplexF64, ComplexF64])
4664+ b = PartialStruct (𝕃, typeof (init), Any[Const (init), Number, ComplexF64])
46654665 c = a ⊔ b
46664666 @test a ⊑ c && b ⊑ c
46674667 @test c isa PartialStruct
46684668 @test c. fields[2 ] === Number
46694669 @test c. fields[3 ] === ComplexF64
46704670 end
46714671 let init = Base. ImmutableDict {Number,Number} ()
4672- a = PartialStruct (typeof (init), Any[Const (init), ComplexF64, ComplexF64])
4673- b = PartialStruct (typeof (init), Any[Const (init), ComplexF32, Union{ComplexF32,ComplexF64}])
4672+ a = PartialStruct (𝕃, typeof (init), Any[Const (init), ComplexF64, ComplexF64])
4673+ b = PartialStruct (𝕃, typeof (init), Any[Const (init), ComplexF32, Union{ComplexF32,ComplexF64}])
46744674 c = a ⊔ b
46754675 @test a ⊑ c && b ⊑ c
46764676 @test c isa PartialStruct
46774677 @test c. fields[2 ] === Complex
46784678 @test c. fields[3 ] === Complex
46794679 end
46804680 let T = Base. ImmutableDict{Number,Number}
4681- a = PartialStruct (T, Any[T])
4682- b = PartialStruct (T, Any[T, Number, Number])
4681+ a = PartialStruct (𝕃, T, Any[T])
4682+ b = PartialStruct (𝕃, T, Any[T, Number, Number])
46834683 @test b ⊑ a
46844684 c = a ⊔ b
46854685 @test a ⊑ c && b ⊑ c
46864686 @test c isa PartialStruct
46874687 @test length (c. fields) == 1
46884688 end
46894689 let T = Base. ImmutableDict{Number,Number}
4690- a = PartialStruct (T, Any[T])
4690+ a = PartialStruct (𝕃, T, Any[T])
46914691 b = Const (T ())
46924692 c = a ⊔ b
46934693 @test a ⊑ c && b ⊑ c
46944694 @test c === T
46954695 end
46964696 let T = Base. ImmutableDict{Number,Number}
46974697 a = Const (T ())
4698- b = PartialStruct (T, Any[T])
4698+ b = PartialStruct (𝕃, T, Any[T])
46994699 c = a ⊔ b
47004700 @test a ⊑ c && b ⊑ c
47014701 @test c === T
@@ -4742,22 +4742,23 @@ end
47424742
47434743let ⊑ = Core. Compiler. partialorder (Core. Compiler. fallback_lattice)
47444744 ⊔ = Core. Compiler. join (Core. Compiler. fallback_lattice)
4745+ 𝕃 = Core. Compiler. fallback_lattice
47454746 Const, PartialStruct = Core. Const, Core. PartialStruct
47464747
4747- @test (Const ((1 ,2 )) ⊑ PartialStruct (Tuple{Int,Int}, Any[Const (1 ),Int]))
4748- @test ! (Const ((1 ,2 )) ⊑ PartialStruct (Tuple{Int,Int,Int}, Any[Const (1 ),Int,Int]))
4749- @test ! (Const ((1 ,2 ,3 )) ⊑ PartialStruct (Tuple{Int,Int}, Any[Const (1 ),Int]))
4750- @test (Const ((1 ,2 ,3 )) ⊑ PartialStruct (Tuple{Int,Int,Int}, Any[Const (1 ),Int,Int]))
4751- @test (Const ((1 ,2 )) ⊑ PartialStruct (Tuple{Int,Vararg{Int}}, Any[Const (1 ),Vararg{Int}]))
4752- @test (Const ((1 ,2 )) ⊑ PartialStruct (Tuple{Int,Int,Vararg{Int}}, Any[Const (1 ),Int,Vararg{Int}])) broken= true
4753- @test (Const ((1 ,2 ,3 )) ⊑ PartialStruct (Tuple{Int,Int,Vararg{Int}}, Any[Const (1 ),Int,Vararg{Int}]))
4754- @test ! (PartialStruct (Tuple{Int,Int}, Any[Const (1 ),Int]) ⊑ Const ((1 ,2 )))
4755- @test ! (PartialStruct (Tuple{Int,Int,Int}, Any[Const (1 ),Int,Int]) ⊑ Const ((1 ,2 )))
4756- @test ! (PartialStruct (Tuple{Int,Int}, Any[Const (1 ),Int]) ⊑ Const ((1 ,2 ,3 )))
4757- @test ! (PartialStruct (Tuple{Int,Int,Int}, Any[Const (1 ),Int,Int]) ⊑ Const ((1 ,2 ,3 )))
4758- @test ! (PartialStruct (Tuple{Int,Vararg{Int}}, Any[Const (1 ),Vararg{Int}]) ⊑ Const ((1 ,2 )))
4759- @test ! (PartialStruct (Tuple{Int,Int,Vararg{Int}}, Any[Const (1 ),Int,Vararg{Int}]) ⊑ Const ((1 ,2 )))
4760- @test ! (PartialStruct (Tuple{Int,Int,Vararg{Int}}, Any[Const (1 ),Int,Vararg{Int}]) ⊑ Const ((1 ,2 ,3 )))
4748+ @test (Const ((1 ,2 )) ⊑ PartialStruct (𝕃, Tuple{Int,Int}, Any[Const (1 ),Int]))
4749+ @test ! (Const ((1 ,2 )) ⊑ PartialStruct (𝕃, Tuple{Int,Int,Int}, Any[Const (1 ),Int,Int]))
4750+ @test ! (Const ((1 ,2 ,3 )) ⊑ PartialStruct (𝕃, Tuple{Int,Int}, Any[Const (1 ),Int]))
4751+ @test (Const ((1 ,2 ,3 )) ⊑ PartialStruct (𝕃, Tuple{Int,Int,Int}, Any[Const (1 ),Int,Int]))
4752+ @test (Const ((1 ,2 )) ⊑ PartialStruct (𝕃, Tuple{Int,Vararg{Int}}, Any[Const (1 ),Vararg{Int}]))
4753+ @test (Const ((1 ,2 )) ⊑ PartialStruct (𝕃, Tuple{Int,Int,Vararg{Int}}, Any[Const (1 ),Int,Vararg{Int}])) broken= true
4754+ @test (Const ((1 ,2 ,3 )) ⊑ PartialStruct (𝕃, Tuple{Int,Int,Vararg{Int}}, Any[Const (1 ),Int,Vararg{Int}]))
4755+ @test ! (PartialStruct (𝕃, Tuple{Int,Int}, Any[Const (1 ),Int]) ⊑ Const ((1 ,2 )))
4756+ @test ! (PartialStruct (𝕃, Tuple{Int,Int,Int}, Any[Const (1 ),Int,Int]) ⊑ Const ((1 ,2 )))
4757+ @test ! (PartialStruct (𝕃, Tuple{Int,Int}, Any[Const (1 ),Int]) ⊑ Const ((1 ,2 ,3 )))
4758+ @test ! (PartialStruct (𝕃, Tuple{Int,Int,Int}, Any[Const (1 ),Int,Int]) ⊑ Const ((1 ,2 ,3 )))
4759+ @test ! (PartialStruct (𝕃, Tuple{Int,Vararg{Int}}, Any[Const (1 ),Vararg{Int}]) ⊑ Const ((1 ,2 )))
4760+ @test ! (PartialStruct (𝕃, Tuple{Int,Int,Vararg{Int}}, Any[Const (1 ),Int,Vararg{Int}]) ⊑ Const ((1 ,2 )))
4761+ @test ! (PartialStruct (𝕃, Tuple{Int,Int,Vararg{Int}}, Any[Const (1 ),Int,Vararg{Int}]) ⊑ Const ((1 ,2 ,3 )))
47614762
47624763 t = Const ((false , false )) ⊔ Const ((false , true ))
47634764 @test t isa PartialStruct && length (t. fields) == 2 && t. fields[1 ] === Const (false )
@@ -4899,7 +4900,7 @@ let src = code_typed1() do
48994900end
49004901
49014902# Test that Const ⊑ PartialStruct respects vararg
4902- @test Const ((1 ,2 )) ⊑ PartialStruct (Tuple{Vararg{Int}}, [Const (1 ), Vararg{Int}])
4903+ @test Const ((1 ,2 )) ⊑ PartialStruct (Core . Compiler . fallback_lattice, Tuple{Vararg{Int}}, [Const (1 ), Vararg{Int}])
49034904
49044905# Test that semi-concrete interpretation doesn't break on functions with while loops in them.
49054906Base. @assume_effects :consistent :effect_free :terminates_globally function pure_annotated_loop (x:: Int , y:: Int )
0 commit comments