Project

General

Profile

Bug #13898

Block parsing regression

Added by tt (Troels Thomsen) 4 months ago. Updated 4 months ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:82799]

Description

Upgrading to Ruby 2.4.2p198 from Ruby 2.4.1p111 introduces the following regression:

irb(main):001:0> def let(x, &b); end
=> :let
irb(main):002:0> let :foo { nil }
SyntaxError: (irb):2: syntax error, unexpected '{', expecting end-of-input
let :foo { nil }
          ^
        from /home/tt/.rubies/ruby-2.4.2/bin/irb:11:in `<main>'

Related issues

Related to Ruby trunk - Bug #13547: [].delete 1 { 'NG' }Closed
Has duplicate Ruby trunk - Bug #13939: Ruby 2.4.2 has issue supporting Seattle.rb style for define_methodRejected
Has duplicate Ruby trunk - Bug #13976: SyntaxError if curly brace block follows args without parentheses, introduced in 2.4.2Closed

History

#1 [ruby-core:82800] Updated by tt (Troels Thomsen) 4 months ago

let(:foo) { nil } and let :foo do nil end (and let(:foo) do nil end) works.

#2 Updated by nobu (Nobuyoshi Nakada) 4 months ago

  • Related to Bug #13547: [].delete 1 { 'NG' } added

#3 Updated by nobu (Nobuyoshi Nakada) 4 months ago

  • Status changed from Open to Rejected

#4 [ruby-core:82823] Updated by markus_d (Markus Doits) 4 months ago

Just got this error too after an update from 2.4.1 to 2.4.2.

Is this really the correct way to break the syntax in minor updates? I mean, going from 2.4 to 2.5 I might expect some syntax changes, but 2.4.1 to 2.4.2 should not break the syntax IMO (even if the behavior was not intended in the first place), even thought ruby does not follow semver.

At least an entry should be added to the changelog and/or caveats section.

#5 Updated by nobu (Nobuyoshi Nakada) 4 months ago

  • Has duplicate Bug #13939: Ruby 2.4.2 has issue supporting Seattle.rb style for define_method added

#6 Updated by shyouhei (Shyouhei Urabe) 4 months ago

  • Has duplicate Bug #13976: SyntaxError if curly brace block follows args without parentheses, introduced in 2.4.2 added

Also available in: Atom PDF