Project

General

Profile

Actions

Bug #20409

open

Missing reporting some invalid breaks

Added by kddnewton (Kevin Newton) 6 months ago. Updated 6 months ago.

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

Updated by kddnewton (Kevin Newton) 6 months ago ยท Edited

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) 6 months ago

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) 6 months ago

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

begin
  break
  nil while false
end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0