Skip to content

Commit 3d6d1d1

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Use VersionConstraint in SdkConstraintVerifier.
[email protected] Change-Id: I458c717ca3d7c51797e3da9ea5cfac4816f4d789 Reviewed-on: https://dart-review.googlesource.com/c/86720 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent c1a0c61 commit 3d6d1d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class SdkConstraintVerifier extends RecursiveAstVisitor<void> {
2323
/// The typ provider used to access SDK types.
2424
final TypeProvider _typeProvider;
2525

26-
/// The range of versions of the SDK that are allowed by the SDK constraints.
27-
final VersionRange _versionRange;
26+
/// The version constraint for the SDK.
27+
final VersionConstraint _versionConstraint;
2828

2929
/// A cached flag indicating whether references to Future and Stream need to
3030
/// be checked. Use [] to access this field.
@@ -33,15 +33,15 @@ class SdkConstraintVerifier extends RecursiveAstVisitor<void> {
3333
/// Initialize a newly created verifier to use the given [_errorReporter] to
3434
/// report errors.
3535
SdkConstraintVerifier(this._errorReporter, this._containingLibrary,
36-
this._typeProvider, this._versionRange);
36+
this._typeProvider, this._versionConstraint);
3737

3838
/// Return a range covering every version up to, but not including, 2.1.0.
3939
VersionRange get before_2_1_0 =>
4040
new VersionRange(max: Version.parse('2.1.0'), includeMax: false);
4141

4242
/// Return `true` if references to Future and Stream need to be checked.
43-
bool get checkFutureAndStream =>
44-
_checkFutureAndStream ??= !before_2_1_0.intersect(_versionRange).isEmpty;
43+
bool get checkFutureAndStream => _checkFutureAndStream ??=
44+
!before_2_1_0.intersect(_versionConstraint).isEmpty;
4545

4646
@override
4747
void visitHideCombinator(HideCombinator node) {

0 commit comments

Comments
 (0)