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

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

Issue 9186015: Issue 933: Fix for resolving type of Function in field. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rollback TypeTestCase change Created 8 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
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 c9761333d2a33ed23b0db34c9bfc79ffed9ce477..8d525904c7b79f2703b49d0f9d0e21db3a0bf258 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -482,6 +482,11 @@ public class TypeAnalyzer implements DartCompilationPhase {
case DYNAMIC:
return member.getType();
default:
+ // target.field() as Function invocation.
+ if (types.isAssignable(functionType, field.getType())) {
+ return dynamicType;
+ }
+ // "field" is not Function, so bad structure.
return typeError(diagnosticNode, TypeErrorCode.USE_ASSIGNMENT_ON_SETTER,
name, receiver);
}

Powered by Google App Engine
This is Rietveld 408576698