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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.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/TypePromotionManager.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java
index 620da0cd472bdc139969f8e9cabbb1d2f00716c6..cd0e0f7bb856cc181daeb7535f2613ec72520e32 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java
@@ -15,6 +15,7 @@ package com.google.dart.engine.internal.resolver;
import com.google.dart.engine.element.Element;
import com.google.dart.engine.element.PropertyAccessorElement;
+import com.google.dart.engine.element.VariableElement;
import com.google.dart.engine.type.Type;
import java.util.Collection;
@@ -124,6 +125,19 @@ public class TypePromotionManager {
}
/**
+ * Returns static type of the given variable - declared or promoted.
+ *
+ * @return the static type of the given variable - declared or promoted
+ */
+ public Type getStaticType(VariableElement variable) {
+ Type staticType = getType(variable);
+ if (staticType == null) {
+ staticType = variable.getType();
+ }
+ return staticType;
+ }
+
+ /**
* Return the promoted type of the given element, or {@code null} if the type of the element has
* not been promoted.
*

Powered by Google App Engine
This is Rietveld 408576698