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

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

Issue 12039023: Issue 8038. Don't report 'is not a function type' if class has 'noSuchMethod'. (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 0da5e8d488d02a531142b3db51c078a55b0f8b14..be86cea99574cd549064dcf468b0808f4e5f527e 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -5350,6 +5350,50 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
/**
+ * Don't report "is not a function type" if class implements "noSuchMethod" method.
+ */
+ public void test_dontReport_ifHas_noSuchMember_isNotFunction() throws Exception {
+ String[] lines = {
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " noSuchMethod(InvocationMirror invocation) {}",
+ "}",
+ "class B extends A {}",
+ "class C {}",
+ "main() {",
+ " A a = new A();",
+ " B b = new B();",
+ " C c = new C();",
+ " a();",
+ " b();",
+ " c();",
+ "}",
+ ""};
+ // report by default
+ {
+ AnalyzeLibraryResult result = analyzeLibrary(lines);
+ assertErrors(
+ result.getErrors(),
+ errEx(TypeErrorCode.NOT_A_FUNCTION_TYPE, 11, 3, 1),
+ errEx(TypeErrorCode.NOT_A_FUNCTION_TYPE, 12, 3, 1),
+ errEx(TypeErrorCode.NOT_A_FUNCTION_TYPE, 13, 3, 1));
+ }
+ // don't report
+ {
+ compilerConfiguration = new DefaultCompilerConfiguration(new CompilerOptions() {
+ @Override
+ public boolean reportNoMemberWhenHasInterceptor() {
+ return false;
+ }
+ });
+ AnalyzeLibraryResult result = analyzeLibrary(lines);
+ assertErrors(
+ result.getErrors(),
+ errEx(TypeErrorCode.NOT_A_FUNCTION_TYPE, 13, 3, 1));
+ }
+ }
+
+ /**
* <p>
* http://code.google.com/p/dart/issues/detail?id=5084
*/
« 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