[#78633] ruby/spec needs help from CRuby committers — Benoit Daloze <eregontp@...>
Currently, ruby/spec is maintained mostly by individuals and enjoys the
13 messages
2016/12/13
[#78963] Re: ruby/spec needs help from CRuby committers
— Urabe Shyouhei <shyouhei@...>
2017/01/04
I did ask attendees of last developer meeting to join this
[#78642] Re: ruby/spec needs help from CRuby committers
— Eric Wong <normalperson@...>
2016/12/14
Benoit Daloze <eregontp@gmail.com> wrote:
[ruby-core:78507] [Ruby trunk Bug#13005][Open] Inline rescue is inconsistent when rescuing NoMethodError
From:
duerst@...
Date:
2016-12-06 07:28:16 UTC
List:
ruby-core #78507
Issue #13005 has been updated by Martin D端rst. Status changed from Closed to Open Assignee set to Yukihiro Matsumoto @matz: Is there a good reason that `o.a = 1 rescue $!.class` is interpreted as `o.a = (1 rescue $1.class)`, while it looks to me as if `o.a = 1 if $!.class` is `(o.a = 1) if $!.class`? (Backwards compatibility might be a reasonable good reason, but I can't imagine it being useful.) ---------------------------------------- Bug #13005: Inline rescue is inconsistent when rescuing NoMethodError https://bugs.ruby-lang.org/issues/13005#change-61889 * Author: Josh Cheek * Status: Open * Priority: Normal * Assignee: Yukihiro Matsumoto * ruby -v: ruby 2.4.0dev (2016-11-16 trunk 56815) [x86_64-darwin15] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- ```ruby o = "some object" class << o private attr_accessor :a end # GETTER can be rescued in a begin-block or inline begin o.a rescue; $!.class # => NoMethodError end o.a rescue $!.class # => NoMethodError # SETTER can be rescued in a begin-block but NOT inline! begin o.a = 1 rescue; $!.class # => NoMethodError end o.a = 1 rescue $!.class # ~> NoMethodError # ~> private method `a=' called for "some object":String # ~> Did you mean? a # ~> # ~> program.rb:18:in `<main>' ``` -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>