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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java

Issue 10540114: Issue 3528. Additional checks for 'case expressions' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java b/compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java
index 303ee79c6e8dd9041d38e9f85284e7a083b9b433..b7c75512cb2803abcb1a729a92d0812dda9514f3 100644
--- a/compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java
+++ b/compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java
@@ -25,6 +25,10 @@ public enum TypeErrorCode implements ErrorCode {
DEFAULT_CONSTRUCTOR_TYPES(
"Constructor '%s' in '%s' has parameters types (%s), doesn't match '%s' in '%s' with (%s)"),
DUPLICATE_NAMED_ARGUMENT("Named parameter argument already provided as positional argument"),
+ CASE_EXPRESSION_SHOULD_BE_INT_STRING(ErrorSeverity.ERROR,
+ "Case expression should be compiler-time constant of type 'int' or 'String', '%s' found"),
+ CASE_EXPRESSIONS_SHOULD_BE_SAME_TYPE(ErrorSeverity.ERROR,
+ "All case expressions should be compiler-time constants of the same type - 'int' or 'String'. '%s' expected but '%s' found"),
EXTRA_ARGUMENT("extra argument"),
FIELD_HAS_NO_GETTER("Field '%s' has no getter"),
FIELD_HAS_NO_SETTER("Field '%s' has no setter"),

Powered by Google App Engine
This is Rietveld 408576698