JuliaLang/julia

disallow return in finally

Open

#57.875 aperta il 24 mar 2025

Vedi su GitHub
 (20 commenti) (9 reazioni) (0 assegnatari)Julia (5773 fork)batch import
breakinghelp wantedminor changeneeds pkgeval

Metriche repository

Star
 (48.709 star)
Metriche merge PR
 (Merge medio 23g 11h) (145 PR mergiate in 30 g)

Descrizione

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.

Guida contributor