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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 184663004: Follow factory redirections when checking case expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove same-type switch-test from type-checker test. Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 const DONT_KNOW_HOW_TO_FIX = ""; 7 const DONT_KNOW_HOW_TO_FIX = "";
8 8
9 /** 9 /**
10 * The messages in this file should meet the following guide lines: 10 * The messages in this file should meet the following guide lines:
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 533
534 static const MessageKind INVALID_CASE_DEFAULT = const MessageKind( 534 static const MessageKind INVALID_CASE_DEFAULT = const MessageKind(
535 "'default' only allowed on last case of a switch."); 535 "'default' only allowed on last case of a switch.");
536 536
537 static const MessageKind SWITCH_CASE_TYPES_NOT_EQUAL = const MessageKind( 537 static const MessageKind SWITCH_CASE_TYPES_NOT_EQUAL = const MessageKind(
538 "'case' expressions do not all have type '#{type}'."); 538 "'case' expressions do not all have type '#{type}'.");
539 539
540 static const MessageKind SWITCH_CASE_TYPES_NOT_EQUAL_CASE = const MessageKind( 540 static const MessageKind SWITCH_CASE_TYPES_NOT_EQUAL_CASE = const MessageKind(
541 "'case' expression of type '#{type}'."); 541 "'case' expression of type '#{type}'.");
542 542
543 static const MessageKind SWITCH_CASE_FORBIDDEN = const MessageKind(
544 "'case' expression may not be of type '#{type}'.");
545
543 static const MessageKind SWITCH_CASE_VALUE_OVERRIDES_EQUALS = 546 static const MessageKind SWITCH_CASE_VALUE_OVERRIDES_EQUALS =
544 const MessageKind( 547 const MessageKind(
545 "'case' expression type '#{type}' overrides 'operator =='."); 548 "'case' expression type '#{type}' overrides 'operator =='.");
546 549
547 static const MessageKind INVALID_ARGUMENT_AFTER_NAMED = const MessageKind( 550 static const MessageKind INVALID_ARGUMENT_AFTER_NAMED = const MessageKind(
548 "Unnamed argument after named argument."); 551 "Unnamed argument after named argument.");
549 552
550 static const MessageKind NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( 553 static const MessageKind NOT_A_COMPILE_TIME_CONSTANT = const MessageKind(
551 "Not a compile-time constant."); 554 "Not a compile-time constant.");
552 555
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 return computeMessage(); 1894 return computeMessage();
1892 } 1895 }
1893 1896
1894 bool operator==(other) { 1897 bool operator==(other) {
1895 if (other is !Message) return false; 1898 if (other is !Message) return false;
1896 return (kind == other.kind) && (toString() == other.toString()); 1899 return (kind == other.kind) && (toString() == other.toString());
1897 } 1900 }
1898 1901
1899 int get hashCode => throw new UnsupportedError('Message.hashCode'); 1902 int get hashCode => throw new UnsupportedError('Message.hashCode');
1900 } 1903 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698