diff --git a/test/channels.jl b/test/channels.jl index 09f973922235f..92a130afbf47b 100644 --- a/test/channels.jl +++ b/test/channels.jl @@ -633,20 +633,3 @@ end @test n_avail(c) == 0 end end - -# Issue #49507: stackoverflow in type inference caused by close(::Channel, ::Exception) -@testset "close(::Channel, ::StackOverflowError)" begin - ch = let result = Channel() - foo() = try - foo() - catch e; - close(result, e) - end - - foo() # This shouldn't fail with an internal stackoverflow error in inference. - - result - end - - @test (try take!(ch) catch e; e; end) isa StackOverflowError -end diff --git a/test/stack_overflow.jl b/test/stack_overflow.jl index 9f4bae6f3f5b3..297186c8a4d3a 100644 --- a/test/stack_overflow.jl +++ b/test/stack_overflow.jl @@ -17,3 +17,20 @@ let exename = Base.julia_cmd() @show readchomperrors(`$exename -e "f() = f(); f()"`) @show readchomperrors(`$exename -e "f() = f(); fetch(@async f())"`) end + +# Issue #49507: stackoverflow in type inference caused by close(::Channel, ::Exception) +@testset "close(::Channel, ::StackOverflowError)" begin + ch = let result = Channel() + foo() = try + foo() + catch e; + close(result, e) + end + + foo() # This shouldn't fail with an internal stackoverflow error in inference. + + result + end + + @test (try take!(ch) catch e; e; end) isa StackOverflowError +end