Skip to content

Commit e10267c

Browse files
stereotype441Commit Queue
authored andcommitted
[flow analysis] Actually remove skipDuplicateCheck.
In https://dart-review.googlesource.com/c/sdk/+/434261, I removed the last call site that was passing a `true` value to the optional parameter `skipDuplicateCheck` of `FlowAnalysis.declare`. I that same CL, I intended to remove parameter itself, but I forgot. This CL finishes the (now unused) parameter. Change-Id: I97dc3c7959d58b58e4b3bbaf7116123899b8ea8b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435980 Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 183d0ad commit e10267c

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -396,16 +396,8 @@ abstract class FlowAnalysis<
396396
/// A function parameter is always initialized, so [initialized] is `true`.
397397
///
398398
/// In debug builds, an assertion will normally verify that no variable gets
399-
/// declared more than once. This assertion may be disabled by passing `true`
400-
/// to [skipDuplicateCheck].
401-
///
402-
/// TODO(paulberry): try to remove all uses of skipDuplicateCheck
403-
void declare(
404-
Variable variable,
405-
Type staticType, {
406-
required bool initialized,
407-
bool skipDuplicateCheck = false,
408-
});
399+
/// declared more than once.
400+
void declare(Variable variable, Type staticType, {required bool initialized});
409401

410402
/// Call this method after visiting a variable pattern in a non-assignment
411403
/// context (or a wildcard pattern).
@@ -1598,17 +1590,10 @@ class FlowAnalysisDebug<
15981590
Variable variable,
15991591
Type staticType, {
16001592
required bool initialized,
1601-
bool skipDuplicateCheck = false,
16021593
}) {
16031594
_wrap(
1604-
'declare($variable, $staticType, '
1605-
'initialized: $initialized, skipDuplicateCheck: $skipDuplicateCheck)',
1606-
() => _wrapped.declare(
1607-
variable,
1608-
staticType,
1609-
initialized: initialized,
1610-
skipDuplicateCheck: skipDuplicateCheck,
1611-
),
1595+
'declare($variable, $staticType, initialized: $initialized)',
1596+
() => _wrapped.declare(variable, staticType, initialized: initialized),
16121597
);
16131598
}
16141599

@@ -5493,11 +5478,10 @@ class _FlowAnalysisImpl<
54935478
Variable variable,
54945479
Type staticType, {
54955480
required bool initialized,
5496-
bool skipDuplicateCheck = false,
54975481
}) {
54985482
assert(staticType == operations.variableType(variable));
54995483
assert(
5500-
_debugDeclaredVariables.add(variable) || skipDuplicateCheck,
5484+
_debugDeclaredVariables.add(variable),
55015485
'Variable $variable already declared',
55025486
);
55035487
_current = _current.declare(

0 commit comments

Comments
 (0)