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

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

Issue 17573004: Report CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE when 'new' even if 'const' constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e730290d6115f82f90d64961d387cec383c3ee87..28ca8cd45137c759874b715261c34c97ddb06e85 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
@@ -175,6 +175,10 @@ public class ConstantVisitor extends GeneralizingASTVisitor<EvaluationResultImpl
@Override
public EvaluationResultImpl visitInstanceCreationExpression(InstanceCreationExpression node) {
+ if (!node.isConst()) {
+ // TODO(brianwilkerson) Figure out which error to report.
+ return error(node, null);
+ }
ConstructorElement constructor = node.getElement();
if (constructor != null && constructor.isConst()) {
node.getArgumentList().accept(this);
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698