Chromium Code Reviews| 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)); |
| } |