Bug #492

defined? a && defined? b

Added by Shyouhei Urabe over 6 years ago. Updated about 4 years ago.

[ruby-dev:35951]
Status:Closed
Priority:Normal
Assignee:Yukihiro Matsumoto
ruby -v: Backport:

Description

=begin
defined? a && defined? b がnilになります。両方定義されてるんだからnilはおかしいはずです。

irb(main):001:0> [RUBY_VERSION, RUBY_REVISION]
=> ["1.9.0", 17576]
irb(main):002:0> a = b = nil
=> nil
irb(main):003:0> defined? a && defined? b
=> nil

1.8ではdefined?(a && defined? b)と解釈されて"expression"になります

irb(main):001:0> [RUBY_VERSION, RUBY_REVISION]
=> ["1.8.7", 17572]
irb(main):002:0> a = b = nil
=> nil
irb(main):003:0> defined? a && defined? b
=> "expression"
irb(main):004:0>
=end

History

#1 Updated by Yukihiro Matsumoto over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r18834.
=end

Also available in: Atom PDF