mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 19:21:30 +00:00
Use VersionConstraint in SdkConstraintVerifier.
R=brianwilkerson@google.com Change-Id: I458c717ca3d7c51797e3da9ea5cfac4816f4d789 Reviewed-on: https://dart-review.googlesource.com/c/86720 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
c1a0c611c3
commit
3d6d1d1755
|
@ -23,8 +23,8 @@ class SdkConstraintVerifier extends RecursiveAstVisitor<void> {
|
|||
/// The typ provider used to access SDK types.
|
||||
final TypeProvider _typeProvider;
|
||||
|
||||
/// The range of versions of the SDK that are allowed by the SDK constraints.
|
||||
final VersionRange _versionRange;
|
||||
/// The version constraint for the SDK.
|
||||
final VersionConstraint _versionConstraint;
|
||||
|
||||
/// A cached flag indicating whether references to Future and Stream need to
|
||||
/// be checked. Use [] to access this field.
|
||||
|
@ -33,15 +33,15 @@ class SdkConstraintVerifier extends RecursiveAstVisitor<void> {
|
|||
/// Initialize a newly created verifier to use the given [_errorReporter] to
|
||||
/// report errors.
|
||||
SdkConstraintVerifier(this._errorReporter, this._containingLibrary,
|
||||
this._typeProvider, this._versionRange);
|
||||
this._typeProvider, this._versionConstraint);
|
||||
|
||||
/// Return a range covering every version up to, but not including, 2.1.0.
|
||||
VersionRange get before_2_1_0 =>
|
||||
new VersionRange(max: Version.parse('2.1.0'), includeMax: false);
|
||||
|
||||
/// Return `true` if references to Future and Stream need to be checked.
|
||||
bool get checkFutureAndStream =>
|
||||
_checkFutureAndStream ??= !before_2_1_0.intersect(_versionRange).isEmpty;
|
||||
bool get checkFutureAndStream => _checkFutureAndStream ??=
|
||||
!before_2_1_0.intersect(_versionConstraint).isEmpty;
|
||||
|
||||
@override
|
||||
void visitHideCombinator(HideCombinator node) {
|
||||
|
|
Loading…
Reference in a new issue