File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,9 @@ class DartScopeBuilder extends VisitorDefault<void> with VisitorVoidMixin {
160160 //
161161 // A null name signals that the variable was synthetically introduced by the
162162 // compiler so they are skipped.
163- if ((decl.fileOffset < 0 || decl.fileOffset < _offset) && name != null ) {
163+ if ((decl.fileOffset < 0 || decl.fileOffset < _offset) &&
164+ ! decl.isWildcard &&
165+ name != null ) {
164166 _definitions[name] = decl.type;
165167 }
166168 super .visitVariableDeclaration (decl);
@@ -289,7 +291,8 @@ class DartScopeBuilder2 extends VisitorDefault<void> with VisitorVoidMixin {
289291 String ? name = decl.name;
290292 if (name != null &&
291293 ! decl.isSynthesized &&
292- ! hoistedUnwritten.contains (decl)) {
294+ ! hoistedUnwritten.contains (decl) &&
295+ ! decl.isWildcard) {
293296 definitions[name] = decl;
294297 }
295298 }
Original file line number Diff line number Diff line change @@ -360,6 +360,9 @@ class ScopeTestingBinaryPrinter extends BinaryPrinter {
360360 if (variable.isHoisted && ! setVariables.contains (variable)) {
361361 // A hoisted variable that isn't set (yet) --- pretend it isn't
362362 // there.
363+ } else if (variable.isWildcard) {
364+ // A wildcard variable doesn't really exist so we'll ignore it,
365+ // see https://github.com/dart-lang/sdk/issues/60841.
363366 } else {
364367 expectedVariablesMap[name] = variable.type;
365368 }
You can’t perform that action at this time.
0 commit comments