Skip to content

Commit b09dd47

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Enforce prefer_typing_uninitialized_variables lint.
[email protected] Change-Id: Icfe4a24a6e69ab08f4743502ae88f94ab9cd8c8a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153951 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 98dec1b commit b09dd47

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pkg/analyzer/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ linter:
1818
rules:
1919
- avoid_unused_constructor_parameters
2020
- empty_statements
21+
- prefer_typing_uninitialized_variables
2122
- unnecessary_brace_in_string_interps
2223
- unnecessary_parenthesis

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,7 @@ class _DiscoverAvailableFilesTask {
22782278

22792279
/// Information about an exception and its context.
22802280
class _ExceptionState {
2281-
final exception;
2281+
final Object exception;
22822282
final StackTrace stackTrace;
22832283

22842284
/// The key under which the context of the exception was stored, or `null`

pkg/analyzer/lib/src/error/best_practices_verifier.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,9 +1526,9 @@ class _InvalidAccessVerifier {
15261526
}
15271527
AstNode grandparent = parent?.parent;
15281528

1529-
var element;
1530-
var name;
1531-
var node;
1529+
Element element;
1530+
String name;
1531+
AstNode node;
15321532

15331533
if (grandparent is ConstructorName) {
15341534
element = grandparent.staticElement;

0 commit comments

Comments
 (0)