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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java

Issue 38353003: Issue 13807. Support for function types promotion. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
index 9d7697872b2edfb9f1cbd4fff1caec9b5ad306b7..14cbe315dd8bd105374a6529bb5e7094aabe0338 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
@@ -1283,10 +1283,8 @@ public class StaticTypeAnalyzer extends SimpleASTVisitor<Void> {
// type = typeProvider.getTypeType());
// }
} else if (element instanceof VariableElement) {
- staticType = promoteManager.getType(element);
- if (staticType == null) {
- staticType = ((VariableElement) element).getType();
- }
+ VariableElement variable = (VariableElement) element;
+ staticType = promoteManager.getStaticType(variable);
} else if (element instanceof PrefixElement) {
return null;
} else {
@@ -1495,7 +1493,8 @@ public class StaticTypeAnalyzer extends SimpleASTVisitor<Void> {
return type.getReturnType();
}
} else if (element instanceof VariableElement) {
- Type variableType = ((VariableElement) element).getType();
+ VariableElement variable = (VariableElement) element;
+ Type variableType = promoteManager.getStaticType(variable);
if (variableType instanceof FunctionType) {
return ((FunctionType) variableType).getReturnType();
}

Powered by Google App Engine
This is Rietveld 408576698