Skip to content

Reject END { break } for Ruby 3.5#3707

Draft
Earlopain wants to merge 1 commit intoruby:mainfrom
Earlopain:end-block-exit
Draft

Reject END { break } for Ruby 3.5#3707
Earlopain wants to merge 1 commit intoruby:mainfrom
Earlopain:end-block-exit

Conversation

@Earlopain
Copy link
Collaborator

@Earlopain Earlopain commented Nov 6, 2025

@Earlopain Earlopain force-pushed the end-block-exit branch 2 times, most recently from 089fcda to 6eb14b3 Compare November 6, 2025 09:30
@kddnewton
Copy link
Collaborator

Do we know if this is mergable yet?

@Earlopain
Copy link
Collaborator Author

I think this was OKed in a dev meeting. I will check and clean this up

@Earlopain
Copy link
Collaborator Author

https://github.com/ruby/dev-meeting-log/blob/f76ba7e3f69feaff70672f0077976d7f63313601/2025/DevMeeting-2025-11-13.md#bug-20409-missing-reporting-some-invalid-breaks-kddnewton

I think this is accepted, END { break } at least? Can't tell for sure. For reference, I tested again how it currently behaves:

END
return - runtime error
break - runtime error
next - ok

BEGIN
return - ok
break - syntax error
next - syntax error

Currently I have return in end still accepted but it also leads to a runtime error. I guess this can be merged as is after rebase, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments