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

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

Issue 11896057: Issue 7605. Check separately getters and setter implementation when check for abstratc members. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5d4988daac37a57d9f1605df7ead58bc6271dead..2507be6f8d7f56d6aaf7b9f553bdd6a67743b7a2 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -596,7 +596,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"}");
assertErrors(
libraryResult.getErrors(),
- errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 8, 7, 1));
+ errEx(TypeErrorCode.CONCRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 8, 7, 1));
{
DartCompilationError typeError = libraryResult.getErrors().get(0);
String message = typeError.getMessage();
@@ -626,7 +626,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"}");
assertErrors(
libraryResult.getErrors(),
- errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 4, 7, 1));
+ errEx(TypeErrorCode.CONCRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 4, 7, 1));
{
DartCompilationError typeError = libraryResult.getErrors().get(0);
String message = typeError.getMessage();
@@ -651,7 +651,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"}");
assertErrors(
libraryResult.getErrors(),
- errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 1, 7, 1));
+ errEx(TypeErrorCode.CONCRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 1, 7, 1));
{
DartCompilationError typeError = libraryResult.getErrors().get(0);
String message = typeError.getMessage();
@@ -680,7 +680,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"}");
assertErrors(
libraryResult.getErrors(),
- errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 1, 7, 1));
+ errEx(TypeErrorCode.CONCRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 1, 7, 1));
}
// disable warnings if has "noSuchMethod"
{
@@ -715,7 +715,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"}");
assertErrors(
libraryResult.getErrors(),
- errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 1, 7, 1));
+ errEx(TypeErrorCode.CONCRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 1, 7, 1));
}
public void test_warnAbstract_onConcreteClassDeclaration_hasUnimplemented_mixin() throws Exception {
@@ -729,7 +729,26 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"");
assertErrors(
result.getErrors(),
- errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 5, 7, 1));
+ errEx(TypeErrorCode.CONCRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 5, 7, 1));
+ }
+
+ /**
+ * Class "B" has implementation for "bVal" and "bVal=", so we don't need any warning.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=7605
+ */
+ public void test_warnAbstract_onConcreteClassDeclaration_inheritedGetter_abstractGetter() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "abstract class A {",
+ " get bVal {}",
+ " set bVal(var val);",
+ "}",
+ "class B extends A {",
+ " set bVal(var val) {}",
+ "}",
+ "");
+ assertErrors(result.getErrors());
}
/**
@@ -770,7 +789,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"}");
assertErrors(
libraryResult.getErrors(),
- errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 5, 7, 1));
+ errEx(TypeErrorCode.CONCRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 5, 7, 1));
}
/**
@@ -6352,7 +6371,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"");
assertErrors(
result.getErrors(),
- errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 10, 7, 1));
+ errEx(TypeErrorCode.CONCRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 10, 7, 1));
}
/**
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698