Skip to content

Commit c4aa754

Browse files
scheglovCommit Queue
authored and
Commit Queue
committed
Issue 52327. Don't report SDK_VERSION_SINCE when pubspec.yaml has exact version of SDK that is greater than the required.
Bug: #52327 Change-Id: I20b86173d59fb725cb715b624348d5ddd289e0f2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302443 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
1 parent ea21df9 commit c4aa754

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ extension on VersionConstraint {
456456
bool requiresAtLeast(Version version) {
457457
final self = this;
458458
if (self is Version) {
459-
return self == version;
459+
return self >= version;
460460
}
461461
if (self is VersionRange) {
462462
final min = self.min;

pkg/analyzer/test/src/diagnostics/sdk_version_since_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,7 @@ class A {}
608608
import 'dart:foo';
609609
610610
void f(A a) {}
611-
''', expectedErrors: [
612-
error(WarningCode.SDK_VERSION_SINCE, 27, 1),
613-
]);
611+
''');
614612
}
615613

616614
test_constraints_exact_less() async {

0 commit comments

Comments
 (0)