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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantVisitor.java

Issue 273703003: Don't generate errors when failing to follow const constructor redirections. (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/constant/ConstantVisitor.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantVisitor.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantVisitor.java
index efea9d7657c410e5098a2d18fea2ace0ebdb4ad5..526beada2b7bf69d2f5bd22fc0f60acc498e5a42 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantVisitor.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantVisitor.java
@@ -300,19 +300,19 @@ public class ConstantVisitor extends UnifyingAstVisitor<EvaluationResultImpl> {
// TODO(paulberry): if the constructor is one of {bool,int,String}.fromEnvironment(),
// we may be able to infer the value based on -D flags provided to the analyzer (see
// dartbug.com/17234).
- return error(node, null);
+ return validWithUnknownValue(definingClass);
}
if (!redirectedConstructor.isConst()) {
// Delegating to a non-const constructor--this is not allowed (and
// is checked elsewhere--see [ErrorVerifier.checkForRedirectToNonConstConstructor()]).
- // So if we encounter it just error out.
- return error(node, null);
+ // So if we encounter it just consider it an unknown value to suppress further errors.
+ return validWithUnknownValue(definingClass);
}
if (constructorsVisited.contains(redirectedConstructor)) {
// Cycle in redirecting factory constructors--this is not allowed
// and is checked elsewhere--see [ErrorVerifier.checkForRecursiveFactoryRedirect()]).
- // So if we encounter it just error out.
- return error(node, null);
+ // So if we encounter it just consider it an unknown value to suppress further errors.
+ return validWithUnknownValue(definingClass);
}
constructor = redirectedConstructor;
definingClass = (InterfaceType) constructor.getReturnType();

Powered by Google App Engine
This is Rietveld 408576698