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

Unified Diff: lib/compiler/implementation/warnings.dart

Issue 10916002: Change switch to give errors when cases don't follow the newest syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: use .compileType on elements. Created 8 years, 3 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: lib/compiler/implementation/warnings.dart
diff --git a/lib/compiler/implementation/warnings.dart b/lib/compiler/implementation/warnings.dart
index 322de1d4e8ec40cd2e324c30caca4f44abcd9ad9..fae9ed3304e375a5e8cdea1b6ad0482f5f6f8d48 100644
--- a/lib/compiler/implementation/warnings.dart
+++ b/lib/compiler/implementation/warnings.dart
@@ -130,11 +130,14 @@ class MessageKind {
'super not allowed here');
static const INVALID_CASE_DEFAULT = const MessageKind(
'default only allowed on last case of a switch');
- static const INVALID_CASE_EXPRESSION = const MessageKind(
- 'case expression is not a compile-time constant int or string.');
- static const INVALID_CASE_EXPRESSION_TYPE = const MessageKind(
- "case expressions don't all have the same type "
- "(must be all int or String).");
+
+ static const SWITCH_CASE_TYPES_NOT_EQUAL = const MessageKind(
+ "case expressions don't all have the same type.");
+ static const SWITCH_CASE_VALUE_OVERRIDES_EQUALS = const MessageKind(
+ "case expression value overrides 'operator=='.");
+ static const SWITCH_INVALID = const MessageKind(
+ "switch cases contain invalid expressions.");
+
static const INVALID_ARGUMENT_AFTER_NAMED = const MessageKind(
'non-named argument after named argument');

Powered by Google App Engine
This is Rietveld 408576698