Skip to content

Commit

Permalink
Enforce prefer_typing_uninitialized_variables lint.
Browse files Browse the repository at this point in the history
R=brianwilkerson@google.com

Change-Id: Icfe4a24a6e69ab08f4743502ae88f94ab9cd8c8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153951
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
scheglov authored and commit-bot@chromium.org committed Jul 10, 2020
1 parent 98dec1b commit b09dd47
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkg/analyzer/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ linter:
rules:
- avoid_unused_constructor_parameters
- empty_statements
- prefer_typing_uninitialized_variables
- unnecessary_brace_in_string_interps
- unnecessary_parenthesis
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/src/dart/analysis/driver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ class _DiscoverAvailableFilesTask {

/// Information about an exception and its context.
class _ExceptionState {
final exception;
final Object exception;
final StackTrace stackTrace;

/// The key under which the context of the exception was stored, or `null`
Expand Down
6 changes: 3 additions & 3 deletions pkg/analyzer/lib/src/error/best_practices_verifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1526,9 +1526,9 @@ class _InvalidAccessVerifier {
}
AstNode grandparent = parent?.parent;

var element;
var name;
var node;
Element element;
String name;
AstNode node;

if (grandparent is ConstructorName) {
element = grandparent.staticElement;
Expand Down

0 comments on commit b09dd47

Please sign in to comment.