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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java

Issue 283213002: Fix for analyzer, 18562, warning for deferred types is now generated on type tests, casts and catch… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
index a978b4c0fbeb1871d64ea39d5a3632ab20e19259..97b1a7491a730cc5ec72fa894410223aaebde3d5 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
@@ -15,6 +15,7 @@ package com.google.dart.engine.internal.verifier;
import com.google.dart.engine.ast.Annotation;
import com.google.dart.engine.ast.ArgumentList;
+import com.google.dart.engine.ast.AsExpression;
import com.google.dart.engine.ast.AssertStatement;
import com.google.dart.engine.ast.AssignmentExpression;
import com.google.dart.engine.ast.AstNode;
@@ -59,6 +60,7 @@ import com.google.dart.engine.ast.ImplementsClause;
import com.google.dart.engine.ast.ImportDirective;
import com.google.dart.engine.ast.IndexExpression;
import com.google.dart.engine.ast.InstanceCreationExpression;
+import com.google.dart.engine.ast.IsExpression;
import com.google.dart.engine.ast.ListLiteral;
import com.google.dart.engine.ast.MapLiteral;
import com.google.dart.engine.ast.MapLiteralEntry;
@@ -454,6 +456,12 @@ public class ErrorVerifier extends RecursiveAstVisitor<Void> {
}
@Override
+ public Void visitAsExpression(AsExpression node) {
+ checkForTypeAnnotationDeferredClass(node.getType());
+ return super.visitAsExpression(node);
+ }
+
+ @Override
public Void visitAssertStatement(AssertStatement node) {
checkForNonBoolExpression(node);
return super.visitAssertStatement(node);
@@ -533,6 +541,7 @@ public class ErrorVerifier extends RecursiveAstVisitor<Void> {
boolean previousIsInCatchClause = isInCatchClause;
try {
isInCatchClause = true;
+ checkForTypeAnnotationDeferredClass(node.getExceptionType());
return super.visitCatchClause(node);
} finally {
isInCatchClause = previousIsInCatchClause;
@@ -890,6 +899,12 @@ public class ErrorVerifier extends RecursiveAstVisitor<Void> {
}
@Override
+ public Void visitIsExpression(IsExpression node) {
+ checkForTypeAnnotationDeferredClass(node.getType());
+ return super.visitIsExpression(node);
+ }
+
+ @Override
public Void visitListLiteral(ListLiteral node) {
TypeArgumentList typeArguments = node.getTypeArguments();
if (typeArguments != null) {

Powered by Google App Engine
This is Rietveld 408576698