Extract to function incorrectly marks refactoring as unavailable when using for loop with a lambda. #12711
Labels
bug
Feature: Extract to function
Extract to function (free function or member function)
investigate: repro
This issue's repro steps needs to be investigated/confirmed
Language Service
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
When using a lambda with a return value inside of a for loop, cpptools will not allow for extracting to function refactor. The extract to function button is grayed out in the context menu with no reason as to why. When the keyboard shortcut is used (ctrl-shift-r & ctrl-e), the reason given for not being able to extract is because the for loop has control paths that exit without the return value.
Minimal reproducible example:
Steps to reproduce:
Expected behavior:
Extract to function is successful and prompts with function name.
The text was updated successfully, but these errors were encountered: