Scenario: Referenced local variables should be passed to the extracted function