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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.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 | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index d70e077e630a5090859cab6c14072a69f673ec08..f244fad5c4fce5840497893743d0d6a0626c3ba2 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -2818,7 +2818,11 @@ public class TypeAnalyzer implements DartCompilationPhase {
// A subtype of interface Function.
return dynamicType;
} else if (name == null || currentClass == null) {
- return typeError(diagnosticNode, TypeErrorCode.NOT_A_FUNCTION_TYPE, type);
+ if (reportNoMemberWhenHasInterceptor || !(type instanceof InterfaceType)
+ || !Elements.handlesNoSuchMethod((InterfaceType) type)) {
+ return typeError(diagnosticNode, TypeErrorCode.NOT_A_FUNCTION_TYPE, type);
+ }
+ return dynamicType;
} else {
return typeError(diagnosticNode, TypeErrorCode.NOT_A_METHOD_IN, name, currentClass);
}
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698