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

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

Issue 10459012: Issue 3223. Don't warn about types compatibility is one of the types was inferred (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 0281231996687564ee66a8fa8118a46214d456a3..9d6c230fff877097f5f4ac2ae6593d2e3db0e499 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -1430,6 +1430,34 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
/**
+ * It was requested that even if Editor can be helpful and warn about types incompatibility, it
+ * should not do this to completely satisfy specification.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=3223
+ */
+ public void test_typesPropagation_noExtraWarnings() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "f(int v) {}",
+ "f1() {",
+ " var v = true;",
+ " f(v);",
+ "}",
+ "f2(var v) {",
+ " if (v is bool) {",
+ " f(v);",
+ " }",
+ "}",
+ "f3(var v) {",
+ " while (v is bool) {",
+ " f(v);",
+ " }",
+ "}",
+ "");
+ assertErrors(libraryResult.getErrors());
+ }
+
+ /**
* There was problem that using <code>() -> bool</code> getter in negation ('!') caused assignment
* warnings. Actual reason was that with negation getter access is visited twice and on the second
* time type of getter method, instead of return type, was returned.

Powered by Google App Engine
This is Rietveld 408576698