JuliaLang/julia

disallow return in finally

Open

#57 875 ouverte le 24 mars 2025

Voir sur GitHub
 (20 commentaires) (9 réactions) (0 assignés)Julia (5 773 forks)batch import
breakinghelp wantedminor changeneeds pkgeval

Métriques du dépôt

Stars
 (48 709 stars)
Métriques de merge PR
 (Merge moyen 23j 11h) (145 PRs mergées en 30 j)

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.

Guide contributeur