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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 10582003: Issue 1355. Support for call(). Tweaks for element locator and rename refactoring (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Check target range Created 8 years, 6 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 cf57f3d778787fded2a1109c98abf8e8b34d4ea7..04a68412644be64a2dc3ea8ed19ac04e57adba9b 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -2163,6 +2163,15 @@ public class TypeAnalyzer implements DartCompilationPhase {
return dynamicType;
default:
type = element.getType();
+ // attempt to resolve to "call()" method invocation
+ if (type instanceof InterfaceType) {
+ InterfaceType interfaceType = (InterfaceType) type;
+ Element callElement = interfaceType.getElement().lookupLocalElement("call");
+ if (ElementKind.of(callElement) == ElementKind.METHOD) {
+ node.setElement(callElement);
+ type = typeAsMemberOf(callElement, interfaceType);
+ }
+ }
break;
}
return checkInvocation(node, target, name, type);
« 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