Project

General

Profile

Actions

Bug #3724

closed

instance_variables comparison not working with symbol ?

Added by fridim (Guillaume Coré) over 13 years ago. Updated almost 13 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby-1.9.1-p378
Backport:
[ruby-core:31788]

Description

=begin
ruby-1.9.1-p378 > class A; attr_accessor :ok; end
=> nil
ruby-1.9.1-p378 > a = A.new
=> #<A:0x8d2b0b8>
ruby-1.9.1-p378 > a.ok = 2
=> 2
ruby-1.9.1-p378 > a.instance_variables
=> [:ok]
ruby-1.9.1-p378 > a.instance_variables.class
=> Array
ruby-1.9.1-p378 > a.instance_variables.first.class
=> Symbol
ruby-1.9.1-p378 > a.instance_variables.include? :ok
=> false
ruby-1.9.1-p378 > b = [:ok]
=> [:ok]
ruby-1.9.1-p378 > b.first.class
=> Symbol
ruby-1.9.1-p378 > b.include? :ok
=> true

same for 1.9.2
=end

Actions #1

Updated by fridim (Guillaume Coré) over 13 years ago

=begin
OK. it's because I enabled Wirble in IRB! I should report this to Wirble instead :)

ruby-1.9.1-p378 > a = :@ok
=> :ok

My bad
=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

  • Category deleted (core)
  • Status changed from Open to Third Party's Issue

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0