JuliaLang/julia

disallow return in finally

Open

#57.875 aberto em 24 de mar. de 2025

Ver no GitHub
 (20 comments) (9 reactions) (0 assignees)Julia (5.773 forks)batch import
breakinghelp wantedminor changeneeds pkgeval

Métricas do repositório

Stars
 (48.709 stars)
Métricas de merge de PR
 (Mesclagem média 23d 11h) (145 fundiu PRs em 30d)

Description

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.

Guia do colaborador