File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2513,6 +2513,16 @@ class NodeReplacer extends ThrowingAstVisitor<bool> {
2513
2513
return visitNode (node);
2514
2514
}
2515
2515
2516
+ @override
2517
+ bool ? visitForEachPartsWithPattern (ForEachPartsWithPattern node) {
2518
+ if (identical (node.iterable, _oldNode)) {
2519
+ (node as ForEachPartsWithPatternImpl ).iterable =
2520
+ _newNode as ExpressionImpl ;
2521
+ return true ;
2522
+ }
2523
+ return visitNode (node);
2524
+ }
2525
+
2516
2526
@override
2517
2527
bool visitForElement (ForElement node) {
2518
2528
if (identical (node.forLoopParts, _oldNode)) {
Original file line number Diff line number Diff line change @@ -876,6 +876,22 @@ void f() {
876
876
);
877
877
}
878
878
879
+ void test_forEachPartsWithPattern () {
880
+ var findNode = _parseStringToFindNode (r'''
881
+ void f() {
882
+ for (var (a) in []) {}
883
+ for (var (b) in []) {}
884
+ }
885
+ ''' );
886
+ _assertReplacementForChildren <ForEachPartsWithPattern >(
887
+ destination: findNode.forEachPartsWithPattern ('(a)' ),
888
+ source: findNode.forEachPartsWithPattern ('(b)' ),
889
+ childAccessors: [
890
+ (node) => node.iterable,
891
+ ],
892
+ );
893
+ }
894
+
879
895
void test_forEachStatement_withIdentifier () {
880
896
var findNode = _parseStringToFindNode (r'''
881
897
void f(int a) {
You can’t perform that action at this time.
0 commit comments