Skip to content

Commit a06cb6c

Browse files
authored
add regression test for self referencesing struct (#25445)
1 parent eab372a commit a06cb6c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/inference.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,3 +1305,15 @@ f_pure_add() = (1 + 1 == 2) ? true : "FAIL"
13051305
@test Core.Inference.getfield_tfunc(Const(Int), Const(:mutable)) == Const(false)
13061306
@test Core.Inference.getfield_tfunc(Const(Vector{Int}), Const(:mutable)) == Const(true)
13071307
@test Core.Inference.getfield_tfunc(DataType, Const(:mutable)) == Bool
1308+
1309+
struct Foo_22708
1310+
x::Ptr{Foo_22708}
1311+
end
1312+
1313+
f_22708(x::Int) = f_22708(Foo_22708, x)
1314+
f_22708(::Type{Foo_22708}, x) = bar_22708("x")
1315+
f_22708(x) = x
1316+
bar_22708(x) = f_22708(x)
1317+
1318+
@test bar_22708(1) == "x"
1319+

0 commit comments

Comments
 (0)