21 Star 49 Fork 0

Gitee 极速下载/julia-language

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/JuliaLang/julia
克隆/下载
stack_overflow.jl 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
# This file is a part of Julia. License is MIT: https://julialang.org/license
using Test
# helper function for returning stderr and stdout
# from running a command (ignoring failure status)
function readchomperrors(exename::Cmd)
out = Base.PipeEndpoint()
err = Base.PipeEndpoint()
p = run(exename, devnull, out, err, wait=false)
o = @async(readchomp(out))
e = @async(readchomp(err))
return (success(p), fetch(o), fetch(e))
end
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mirrors/julia-language.git
git@gitee.com:mirrors/julia-language.git
mirrors
julia-language
julia-language
master

搜索帮助