Inspectopedia
 
2024.3

Variable declaration could be moved inside 'when'

Info
New
Last modified: 03 December 2024

Reports variable declarations that can be moved inside a when expression.

Example:

After the quick-fix is applied: