Skip to content

Commit 1e775d7

Browse files
authored
add a test that error can be inferred to bottom (#35806)
1 parent c242166 commit 1e775d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/compiler/inference.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,3 +3008,6 @@ f38888() = S38888(Base.inferencebarrier(3))
30083008
@test f38888() isa S38888
30093009
g38888() = S38888(Base.inferencebarrier(3), nothing)
30103010
@test g38888() isa S38888
3011+
3012+
f_inf_error_bottom(x::Vector) = isempty(x) ? error(x[1]) : x
3013+
@test Core.Compiler.return_type(f_inf_error_bottom, Tuple{Vector{Any}}) == Vector{Any}

0 commit comments

Comments
 (0)