Remove double.CAPITAL constants.
Presubmit: https://fusion2.corp.google.com/presubmit/tap/404922794/OCL:404922794:BASE:405010232:1634915532338:93e197a/targets
Change-Id: Ib29a079678eced84e6d3a4f322c64a548b3668c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217781
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index bb75f07..f0dc96e 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,5 +1,6 @@
## 2.8.0-dev
* Deprecations and renames for `getXyz` methods in `AnalysisDriver`.
+* Removed uppercase named constants from `double` in mock SDK.
## 2.7.0
* Updated `ConstructorElement.displayName` to either `Class` or `Class.constructor`.
diff --git a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
index 994bd26..198b6a8 100644
--- a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
+++ b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
@@ -318,13 +318,6 @@
}
abstract class double extends num {
- // TODO: remove these old constants when no tests rely on them.
- static const double NAN = 0.0 / 0.0;
- static const double INFINITY = 1.0 / 0.0;
- static const double NEGATIVE_INFINITY = -INFINITY;
- static const double MIN_POSITIVE = 5e-324;
- static const double MAX_FINITE = 1.7976931348623157e+308;
-
static const double nan = 0.0 / 0.0;
static const double infinity = 1.0 / 0.0;
static const double negativeInfinity = -infinity;
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 3770d7c..bf708fc 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -1012,7 +1012,7 @@
const A(x);
}
main() {
- const A(double.INFINITY);
+ const A(double.infinity);
}
''');
}
@@ -2382,7 +2382,7 @@
test_nonConstantDefaultValue_constField() async {
await assertNoErrorsInCode(r'''
-f([a = double.INFINITY]) {
+f([a = double.infinity]) {
}
''');
}
@@ -2457,7 +2457,7 @@
test_nonConstListElement_constField() async {
await assertNoErrorsInCode(r'''
main() {
- const [double.INFINITY];
+ const [double.infinity];
}
''');
}
@@ -2491,7 +2491,7 @@
test_nonConstMapValue_constField() async {
await assertNoErrorsInCode(r'''
main() {
- const {0: double.INFINITY};
+ const {0: double.infinity};
}
''');
}
diff --git a/pkg/analyzer/test/generated/statement_parser_test.dart b/pkg/analyzer/test/generated/statement_parser_test.dart
index 5e90e69..ff93ba2 100644
--- a/pkg/analyzer/test/generated/statement_parser_test.dart
+++ b/pkg/analyzer/test/generated/statement_parser_test.dart
@@ -1079,7 +1079,7 @@
}
void test_parseNonLabeledStatement_typeCast() {
- var statement = parseStatement('double.NAN as num;') as ExpressionStatement;
+ var statement = parseStatement('double.nan as num;') as ExpressionStatement;
assertNoErrors();
expect(statement.expression, isNotNull);
}
diff --git a/pkg/analyzer/test/src/diagnostics/const_map_key_expression_type_implements_equals_test.dart b/pkg/analyzer/test/src/diagnostics/const_map_key_expression_type_implements_equals_test.dart
index 6b2a23b..c592ea3 100644
--- a/pkg/analyzer/test/src/diagnostics/const_map_key_expression_type_implements_equals_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_map_key_expression_type_implements_equals_test.dart
@@ -32,7 +32,7 @@
test_constField() async {
await assertErrorsInCode(r'''
main() {
- const {double.INFINITY: 0};
+ const {double.infinity: 0};
}
''', [
error(
diff --git a/pkg/nnbd_migration/test/edge_builder_test.dart b/pkg/nnbd_migration/test/edge_builder_test.dart
index 133f7d5..fcec048 100644
--- a/pkg/nnbd_migration/test/edge_builder_test.dart
+++ b/pkg/nnbd_migration/test/edge_builder_test.dart
@@ -590,9 +590,9 @@
Future<void> test_already_migrated_field() async {
await analyze('''
-double f() => double.NAN;
+double f() => double.nan;
''');
- var nanElement = typeProvider.doubleType.element.getField('NAN')!;
+ var nanElement = typeProvider.doubleType.element.getField('nan')!;
assertEdge(variables!.decoratedElementType(nanElement).node,
decoratedTypeAnnotation('double f').node,
hard: false);