You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing inline value for object/record pattern and for loops #5547
Is your feature request related to a problem? Please describe.
Inline values show for parameters but not for pattern destruction blocks. This forces me to hover the assigned variable instead of simply looking at the value.
Describe the solution you'd like
When destructing the record (repro below) into x and y, and always in for loops, we should see the new declared/assigned variable value.
Describe alternatives you've considered
Hovering over the variable or adding to watch.
Additional context
Repro:
classA {
List<int> list = [1, 2, 3];
voidm(int value, List<(int, int)> records) {
for (var x in list) { // B1 here, all parameters showprint(value); // B2 here, same as aboveprint(x);
}
for (var (x, y) in records) {
print(value); // B3 here, since the iterable above is not a getter, we see its value being used too
x + y;
}
}
}
voidmain() {
A().m(0, [(1, 2)]);
}
https://dart-review.googlesource.com/c/sdk/+/434860 fixes the for loop identifiers and destructured variables, though I've opened #5550 separately about list (the class getter) not showing up, since it seems we're missing getters in a few places.
Activity
DanTup commentedon Jun 16, 2025
https://dart-review.googlesource.com/c/sdk/+/434860 fixes the for loop identifiers and destructured variables, though I've opened #5550 separately about
list(the class getter) not showing up, since it seems we're missing getters in a few places.[analysis_server] Include declared identifiers and destructed variabl…
DanTup commentedon Jun 16, 2025
Fixed by dart-lang/sdk@a54c46c