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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java

Issue 397823004: Detect invalid const constructor due to non-const initializer in field declaration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment fix Created 6 years, 5 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/error/CompileTimeErrorCode.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
index 23484b8f7cc9aa743e6dde559f248f3f54d104b1..e0a922a583b5d796240c47c1fcae7beb4a5128a6 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
@@ -170,6 +170,15 @@ public enum CompileTimeErrorCode implements ErrorCode {
"Cannot define the 'const' constructor for a class with non-final fields"),
/**
+ * 10.6.3 Constant Constructors: It is a compile-time error if a constant constructor is declared
+ * by a class C if any instance variable declared in C is initialized with an expression that is
+ * not a constant expression.
+ */
+ CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST(
scheglov 2014/07/20 18:55:16 I think this constant should be moved up to keep c
Paul Berry 2014/07/21 15:52:14 Done.
+ "Can't define the 'const' constructor because the field '%s' is initialized with a "
+ + "non-constant value"),
+
+ /**
* 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type.
*/
CONST_DEFERRED_CLASS("Deferred classes cannot be created with 'const'"),

Powered by Google App Engine
This is Rietveld 408576698