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

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

Issue 10913033: Issue 4849. Disabling using inferred types for warnings should also disable invocation argument typ… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Replace <dynamic> with Dynamic Created 8 years, 4 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 bdcdc5a238c77ef0433210cdbc889ef9abc04874..69a6f9d919883c02ad4c2051cabb372233e36bcc 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -1352,7 +1352,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
{
DartMethodDefinition fB = (DartMethodDefinition) unit.getTopLevelNodes().get(1);
- assertEquals("<dynamic>", fB.getElement().getReturnType().getElement().getName());
+ assertEquals("Dynamic", fB.getElement().getReturnType().getElement().getName());
}
{
DartMethodDefinition fC = (DartMethodDefinition) unit.getTopLevelNodes().get(2);
@@ -1360,7 +1360,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
{
DartMethodDefinition fD = (DartMethodDefinition) unit.getTopLevelNodes().get(3);
- assertEquals("<dynamic>", fD.getElement().getReturnType().getElement().getName());
+ assertEquals("Dynamic", fD.getElement().getReturnType().getElement().getName());
}
}
@@ -1966,6 +1966,27 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
}
+ /**
+ * When we resolved method from inferred type, it is possible that arguments of invocation
+ * don't is not assignable to the parameters. So, we report warning. But if we would not infer
+ * types, there would be no warnings.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=4849
+ */
+ public void test_inferredTypes_invocationOfMethodFromInferredType_arguments() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " foo(int p) {}",
+ "}",
+ "main() {",
+ " var a = new A();",
+ " a.foo('');",
+ "}",
+ "");
+ assertErrors(result.getErrors());
+ }
+
public void test_typesPropagation_assignAtDeclaration() throws Exception {
analyzeLibrary(
"f() {",

Powered by Google App Engine
This is Rietveld 408576698