Project

General

Profile

Bug #3724

instance_variables comparison not working with symbol ?

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

Status:
Third Party's Issue
Priority:
Normal
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
=> #
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

#1

Updated by fridim (Guillaume Coré) almost 10 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

#2

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

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

=begin

=end

Also available in: Atom PDF