Extract variable refactor should create variables inside of switch statement #52015
Labels
analyzer-refactoring
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Given the following Dart 3.0 code:
If I select the text
o + 1
and perform an "extract variable" refactor, I get:Which has a compile time error, because at the site of
var object = o + 1;
the variableo
is not known to be anint
.I would have expected this instead:
The text was updated successfully, but these errors were encountered: