case statement causes disappearance of local variables #487

Closed
sogabe opened this Issue Oct 11, 2012 · 0 comments

Comments

Projects
None yet
2 participants
Contributor

sogabe commented Oct 11, 2012

Case statement causes disappearance of local variables.

For example:

before 49cac5f

String
"String 1"

after 49cac5f

Foo
Foo

test code:

class Foo
  def test(arg)
    str = String.new
    case arg
    when 1
      str += "String 1"
    when 2
      str += "String 2"
    end
    p str.class
    str
  end
end

f = Foo.new
p f.test(1)

matz closed this in f2da76b Oct 16, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment