JuliaLang/julia

disallow return in finally

Open

#57,875 创建于 2025年3月24日

在 GitHub 查看
 (20 评论) (9 反应) (0 负责人)Julia (5,773 fork)batch import
breakinghelp wantedminor changeneeds pkgeval

仓库指标

Star
 (48,709 star)
PR 合并指标
 (平均合并 20天 6小时) (30 天内合并 157 个 PR)

描述

This is unfortunate:

julia> function f(x)
           try
               error("test")
           finally
               return x
           end
       end

julia> f(4)
4

Brought up by @dalum on Slack. Would be good to simple make return in a finally block a syntax error. Seems unlikely to be widely used.

贡献者指南