We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given this code:
f(g) { } main() { f((x) => x.y + 1); }
Select "x.y" and perform an "extract local variable" refactor. This produces the following result:
f(g) { } main() { var z = x.y; f((x) => z + 1); }
which is incorrect, since x previously referred to the argument of the function literal "(x) => x.y + 1"; now it is an undefined name.
IMHO, the correct result is:
f(g) { } main() { f((x) { var z = x.y; return z + 1; }); }
(that is, the function literal should be converted into block form so that the new variable declaration can go inside it).
The text was updated successfully, but these errors were encountered:
Set owner to @scheglov. Added this to the 1.5 milestone. Removed Priority-Unassigned label. Added Priority-Medium label.
Sorry, something went wrong.
Removed this from the 1.5 milestone. Added this to the 1.6 milestone.
Removed this from the 1.6 milestone. Added Oldschool-Milestone-1.6 label.
Removed Oldschool-Milestone-1.6 label.
Removed Area-Editor label. Added Area-Analyzer, Analyzer-Refactoring labels.
https://codereview.chromium.org/568333003
Added Started label.
https://code.google.com/p/dart/source/detail?r=40250
Added Fixed label.
scheglov
No branches or pull requests
Given this code:
f(g) {
}
main() {
f((x) => x.y + 1);
}
Select "x.y" and perform an "extract local variable" refactor. This produces the following result:
f(g) {
}
main() {
var z = x.y;
f((x) => z + 1);
}
which is incorrect, since x previously referred to the argument of the function literal "(x) => x.y + 1"; now it is an undefined name.
IMHO, the correct result is:
f(g) {
}
main() {
f((x) {
var z = x.y;
return z + 1;
});
}
(that is, the function literal should be converted into block form so that the new variable declaration can go inside it).
The text was updated successfully, but these errors were encountered: