@@ -1608,7 +1608,7 @@ f_pure_add() = (1 + 1 == 2) ? true : "FAIL"
1608
1608
@test Core. Compiler. getfield_tfunc (Core. TypeName, Const (:flags )) == UInt8
1609
1609
1610
1610
# getfield on abstract named tuples. issue #32698
1611
- import Core. Compiler. getfield_tfunc
1611
+ import Core. Compiler: getfield_tfunc, Const
1612
1612
@test getfield_tfunc (NamedTuple{(:id , :y ), T} where {T <: Tuple{Int, Union{Float64, Missing}} },
1613
1613
Const (:y )) == Union{Missing, Float64}
1614
1614
@test getfield_tfunc (NamedTuple{(:id , :y ), T} where {T <: Tuple{Int, Union{Float64, Missing}} },
@@ -1622,6 +1622,23 @@ import Core.Compiler.getfield_tfunc
1622
1622
@test getfield_tfunc (NamedTuple{<: Any , T} where {T <: Tuple{Int, Union{Float64, Missing}} },
1623
1623
Const (:x )) == Union{Missing, Float64, Int}
1624
1624
1625
+ mutable struct ARef{T}
1626
+ @atomic x:: T
1627
+ end
1628
+ @test getfield_tfunc (ARef{Int},Const (:x ),Symbol) === Int
1629
+ @test getfield_tfunc (ARef{Int},Const (:x ),Bool) === Int
1630
+ @test getfield_tfunc (ARef{Int},Const (:x ),Symbol,Bool) === Int
1631
+ @test getfield_tfunc (ARef{Int},Const (:x ),Symbol,Vararg{Symbol}) === Int # `Vararg{Symbol}` might be empty
1632
+ @test getfield_tfunc (ARef{Int},Const (:x ),Vararg{Symbol}) === Int
1633
+ @test getfield_tfunc (ARef{Int},Const (:x ),Any,) === Int
1634
+ @test getfield_tfunc (ARef{Int},Const (:x ),Any,Any) === Int
1635
+ @test getfield_tfunc (ARef{Int},Const (:x ),Any,Vararg{Any}) === Int
1636
+ @test getfield_tfunc (ARef{Int},Const (:x ),Vararg{Any}) === Int
1637
+ @test getfield_tfunc (ARef{Int},Const (:x ),Int) === Union{}
1638
+ @test getfield_tfunc (ARef{Int},Const (:x ),Bool,Symbol) === Union{}
1639
+ @test getfield_tfunc (ARef{Int},Const (:x ),Symbol,Symbol) === Union{}
1640
+ @test getfield_tfunc (ARef{Int},Const (:x ),Bool,Bool) === Union{}
1641
+
1625
1642
struct Foo_22708
1626
1643
x:: Ptr{Foo_22708}
1627
1644
end
0 commit comments