Project

General

Profile

Actions

Bug #20409

open

Missing reporting some invalid breaks

Bug #20409: Missing reporting some invalid breaks

Added by kddnewton (Kevin Newton) over 1 year ago. Updated about 14 hours ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:117434]

Updated by kddnewton (Kevin Newton) over 1 year ago ยท Edited Actions #1 [ruby-core:117435]

Sorry hit enter too soon...

def a
  break
rescue
  b while c
end
def a
  break
ensure
  b while c
end

Updated by kddnewton (Kevin Newton) over 1 year ago Actions #2 [ruby-core:117436]

I think

END { break }

should also be a syntax error, as it seems to always result in a LocalJumpError, but I could be wrong.

Updated by nobu (Nobuyoshi Nakada) over 1 year ago Actions #3 [ruby-core:117439]

It reproduces only with a modifier while/until, even without rescue/ensure.

begin
  break
  nil while false
end

Updated by Earlopain (Earlopain _) about 14 hours ago Actions #4 [ruby-core:123664]

Today I get a syntax error for all the examples in both parsers except for END { break }. Can this be closed or should END { break } still be considered?

Actions

Also available in: PDF Atom