Skip to content

Commit 305c0f3

Browse files
pqCommit Queue
authored andcommitted
[element model] migrate prefer_int_literals
Bug: https://github.com/dart-lang/linter/issues/5099 Change-Id: I539a4612ff5dd6b9df2194b8be4477ea9035c867 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394004 Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
1 parent c38244e commit 305c0f3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pkg/linter/analyzer_use_new_elements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ lib/src/rules/invalid_runtime_check_with_js_interop_types.dart
1111
lib/src/rules/prefer_asserts_in_initializer_lists.dart
1212
lib/src/rules/prefer_final_fields.dart
1313
lib/src/rules/prefer_initializing_formals.dart
14-
lib/src/rules/prefer_int_literals.dart
1514
lib/src/rules/public_member_api_docs.dart
1615
lib/src/rules/unnecessary_overrides.dart
1716
lib/src/rules/unnecessary_this.dart

pkg/linter/lib/src/rules/prefer_int_literals.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ class _Visitor extends SimpleAstVisitor<void> {
6060
bool hasTypeDouble(Expression expression) {
6161
var parent = expression.parent;
6262
if (parent is ArgumentList) {
63-
return _isDartCoreDouble(expression.staticParameterElement?.type);
63+
return _isDartCoreDouble(expression.correspondingParameter?.type);
6464
} else if (parent is ListLiteral) {
6565
var typeArguments = parent.typeArguments?.arguments;
6666
return typeArguments?.length == 1 &&
6767
_isDartCoreDoubleTypeAnnotation(typeArguments!.first);
6868
} else if (parent is NamedExpression) {
6969
var argList = parent.parent;
7070
if (argList is ArgumentList) {
71-
return _isDartCoreDouble(parent.staticParameterElement?.type);
71+
return _isDartCoreDouble(parent.correspondingParameter?.type);
7272
}
7373
} else if (parent is ExpressionFunctionBody) {
7474
return hasReturnTypeDouble(parent.parent);

0 commit comments

Comments
 (0)