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

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

Issue 11428055: Issue 6964. Optionally don't warn in Editor when class with noSuchMethod() has unimplemented member… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 fd5391c207c3dbce31a5b6058ff6558d98247791..1c55dd2b4f362a2c3e7d9fdb71a4732d47ded0b9 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -617,6 +617,49 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
}
+ /**
+ * When class implements "noSuchMethod", we presume that it will handle unimplemented methods.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=6964
+ */
+ public void test_warnAbstract_onConcreteClassDeclaration_hasUnimplementedMethod_noSuchMethod()
+ throws Exception {
+ // report by default
+ {
+ AnalyzeLibraryResult libraryResult =
+ analyzeLibrary(
+ "class A {",
+ " void foo();",
+ " noSuchMethod(InvocationMirror m) {}",
+ "}",
+ "main() {",
+ " new A();",
+ "}");
+ assertErrors(
+ libraryResult.getErrors(),
+ errEx(TypeErrorCode.CONTRETE_CLASS_WITH_UNIMPLEMENTED_MEMBERS, 1, 7, 1));
+ }
+ // disable warnings if has "noSuchMethod"
+ {
+ compilerConfiguration = new DefaultCompilerConfiguration(new CompilerOptions() {
+ @Override
+ public boolean reportNoMemberWhenHasInterceptor() {
+ return false;
+ }
+ });
+ AnalyzeLibraryResult libraryResult =
+ analyzeLibrary(
+ "class A {",
+ " void foo();",
+ " noSuchMethod(InvocationMirror m) {}",
+ "}",
+ "main() {",
+ " new A();",
+ "}");
+ assertErrors(libraryResult.getErrors());
+ }
+ }
+
public void test_warnAbstract_onConcreteClassDeclaration_hasUnimplemented_getter()
throws Exception {
AnalyzeLibraryResult libraryResult =
« 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