Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract method with multiple variables used later #40

Open
dgsuarez opened this issue Apr 18, 2019 · 0 comments
Open

Extract method with multiple variables used later #40

dgsuarez opened this issue Apr 18, 2019 · 0 comments
Labels

Comments

@dgsuarez
Copy link
Owner

dgsuarez commented Apr 18, 2019

class Test
  def variables_used_later
    a = 3
    b = a * 3

    a * b
  end
end

Applying extract method to the first 2 lines of the method results in:

class Test
  def variables_used_later
    b = extracted

    a * b
  end

  def extracted
    a = 3
    a * 3
  end
end

a no longer exists in variables_used_later, but it tries to use it.

@dgsuarez dgsuarez added the bug label Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant