| 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 bd95e53a008b1b3690a9b1c2ee6d01f9f1b6a6f2..aa3e90f9ac10287389d8ddd4602034aecf9173f6 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| @@ -2061,7 +2061,57 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| assertNotNull(equalsElement);
|
| }
|
|
|
| -
|
| + public void test_supertypeHasMethod() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {}",
|
| + "interface I {",
|
| + " foo();",
|
| + " bar();",
|
| + "}",
|
| + "interface J extends I {",
|
| + " get foo();",
|
| + " set bar();",
|
| + "}");
|
| + assertErrors(libraryResult.getTypeErrors(),
|
| + errEx(TypeErrorCode.SUPERTYPE_HAS_METHOD, 8, 7, 3),
|
| + errEx(TypeErrorCode.SUPERTYPE_HAS_METHOD, 9, 7, 3));
|
| + }
|
| +
|
| + public void test_supertypeHasField() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {}",
|
| + "interface I {",
|
| + " var foo;",
|
| + " var bar;",
|
| + "}",
|
| + "interface J extends I {",
|
| + " foo();",
|
| + " bar();",
|
| + "}");
|
| + assertErrors(libraryResult.getTypeErrors(),
|
| + errEx(TypeErrorCode.SUPERTYPE_HAS_FIELD, 8, 3, 3),
|
| + errEx(TypeErrorCode.SUPERTYPE_HAS_FIELD, 9, 3, 3));
|
| + }
|
| +
|
| + public void test_supertypeHasGetterSetter() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {}",
|
| + "interface I {",
|
| + " get foo();",
|
| + " set bar();",
|
| + "}",
|
| + "interface J extends I {",
|
| + " foo();",
|
| + " bar();",
|
| + "}");
|
| + assertErrors(libraryResult.getTypeErrors(),
|
| + errEx(TypeErrorCode.SUPERTYPE_HAS_FIELD, 8, 3, 3),
|
| + errEx(TypeErrorCode.SUPERTYPE_HAS_FIELD, 9, 3, 3));
|
| + }
|
| +
|
| private AnalyzeLibraryResult analyzeLibrary(String... lines) throws Exception {
|
| return analyzeLibrary(getName(), makeCode(lines));
|
| }
|
|
|