Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 1008583002: Fix hints (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 5b0178d4c5c7ffa900c8ee439a0c270ff73683dd..e50f9dcee4579ab5067b96af00a81a6efa73a424 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -1961,23 +1961,22 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
element = accessor.variable;
}
if (element is VariableElement) {
- VariableElement variable = element as VariableElement;
- if (variable.isConst) {
+ if (element.isConst) {
_errorReporter.reportErrorForNode(
StaticWarningCode.ASSIGNMENT_TO_CONST, expression);
return true;
}
- if (variable.isFinal) {
- if (variable is FieldElementImpl &&
- variable.setter == null &&
- variable.isSynthetic) {
+ if (element.isFinal) {
+ if (element is FieldElementImpl &&
+ element.setter == null &&
+ element.isSynthetic) {
_errorReporter.reportErrorForNode(
StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER, highlightedNode,
- [variable.name, variable.enclosingElement.displayName]);
+ [element.name, element.enclosingElement.displayName]);
return true;
}
_errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_FINAL,
- highlightedNode, [variable.name]);
+ highlightedNode, [element.name]);
return true;
}
return false;
@@ -5947,15 +5946,13 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
return false;
}
if (n is ConstructorDeclaration) {
- ConstructorDeclaration constructor = n as ConstructorDeclaration;
- return constructor.factoryKeyword == null;
+ return n.factoryKeyword == null;
}
if (n is ConstructorInitializer) {
return false;
}
if (n is MethodDeclaration) {
- MethodDeclaration method = n as MethodDeclaration;
- return !method.isStatic;
+ return !n.isStatic;
}
}
return false;
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698