Project

General

Profile

Actions

Bug #21662

closed

Variables other than those in the conditional score are replaced.

Bug #21662: Variables other than those in the conditional score are replaced.

Added by binh (binh chau) 1 day ago. Updated about 12 hours ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:123644]

Description

class Bar
  attr_accessor :name
end

class Foo
  attr_accessor :bar
  def initialize(bar=nil)
    @bar = bar || Bar.new
  end

  def bug!
    if !bar.is_a?(Bar)
      bar = ''
    elsif bar.name == 'bar'
    end
  end
end

Foo.new.bug!
Actions

Also available in: PDF Atom