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

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

Issue 10545189: Issue 3643. Associate 'no such method' problem with method name, not with whole invocation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use 'resolutionError' flag in DartIdentifier 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
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 bb34e70758db666770015c997ec8b4ecf95a7dea..e87acf5c2a63e4ea911e957d2a48f55b9735c430 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -660,7 +660,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
" foo();",
"}",
"");
- assertErrors(libraryResult.getErrors(), errEx(ResolverErrorCode.CANNOT_RESOLVE_METHOD, 3, 3, 5));
+ assertErrors(libraryResult.getErrors(), errEx(ResolverErrorCode.CANNOT_RESOLVE_METHOD, 3, 3, 3));
}
/**
@@ -1630,7 +1630,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
assertErrors(
result.getErrors(),
errEx(TypeErrorCode.NOT_A_MEMBER_OF, 9, 5, 1),
- errEx(TypeErrorCode.INTERFACE_HAS_NO_METHOD_NAMED, 10, 3, 5));
+ errEx(TypeErrorCode.INTERFACE_HAS_NO_METHOD_NAMED, 10, 5, 1));
}
// use CompilerConfiguration
{
@@ -2532,6 +2532,35 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
errEx(TypeErrorCode.EXPECTED_POSITIONAL_ARGUMENT, 4, 11, 3));
}
+ public void test_canNotResolveMethod_unqualified() throws Exception {
Brian Wilkerson 2012/06/15 18:18:45 nit: "canNot" --> "cannot"
scheglov 2012/06/15 18:46:09 Done.
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " f() {",
+ " foo();",
+ " }",
+ "}",
+ "");
+ assertErrors(
+ libraryResult.getErrors(),
+ errEx(TypeErrorCode.INTERFACE_HAS_NO_METHOD_NAMED, 4, 5, 3));
+ }
+
+ public void test_canNotResolveMethod_qualified() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ "}",
+ "main() {",
+ " A a = new A();",
+ " a.foo();",
+ "}",
+ "");
+ assertErrors(
+ libraryResult.getErrors(),
+ errEx(TypeErrorCode.INTERFACE_HAS_NO_METHOD_NAMED, 6, 5, 3));
+ }
+
private AnalyzeLibraryResult analyzeLibrary(String... lines) throws Exception {
return analyzeLibrary(getName(), makeCode(lines));
}

Powered by Google App Engine
This is Rietveld 408576698