JuliaLang/julia

disallow return in finally

Ouverte

#57 875 ouverte le 24 mars 2025

 (20 commentaires) (9 réactions) (0 personne assignée)Julia (5 773 forks)batch import
breakinghelp wantedminor changeneeds pkgeval

Métriques du dépôt

Stars
 (48 709 étoiles)
Métriques de merge PR
 (Merge moyen 20j 6h) (157 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