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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java

Issue 10515018: Issue 3269. Warning when 'case' is not type compatible with 'switch' expression (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add valid case expression in test 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
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
index 3922b7a655dac348ce427d94d9e1b750400ca923..3a12f97c1af2794a1523ef436b55bd2cb0cf7691 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
@@ -1077,9 +1077,12 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
public void testSwitch() {
analyze("{ int i = 27; switch(i) { case i: break; } }");
analyze("{ num i = 27; switch(i) { case i: break; } }");
- analyze("{ switch(true) { case 1: break; case 'foo': break; }}");
- analyzeFail("{ int i = 27; switch(true) { case false: i = 2.7; }}",
- TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
+ analyzeFail(
+ "{ switch(true) { case 1: break; case 'foo': break; }}",
+ TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
+ analyzeFail(
+ "{ int i = 27; switch(true) { case false: i = 2.7; }}",
+ TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
}
public void testThis() {
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698