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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/types.dart

Issue 12385076: Infer types of catpured variables and use the types in the SSA builder. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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: sdk/lib/_internal/compiler/implementation/types/types.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/types.dart (revision 19427)
+++ sdk/lib/_internal/compiler/implementation/types/types.dart (working copy)
@@ -25,6 +25,7 @@
*/
abstract class TypesInferrer {
analyzeMain(Element element);
+ getConcreteReturnTypeOfElement(Element element);
getConcreteTypeOfElement(Element element);
getConcreteTypeOfNode(Element owner, Node node);
}
@@ -79,8 +80,8 @@
ConcreteType getGuaranteedTypeOfElement(Element element) {
return measure(() {
if (typesInferrer != null) {
- ConcreteType guaranteedType = typesInferrer
- .getConcreteTypeOfElement(element);
+ ConcreteType guaranteedType =
+ typesInferrer .getConcreteTypeOfElement(element);
if (guaranteedType != null) return guaranteedType;
}
if (!element.isParameter()) return null;
@@ -103,6 +104,17 @@
});
}
+ ConcreteType getGuaranteedReturnTypeOfElement(Element element) {
+ return measure(() {
+ if (typesInferrer != null) {
+ ConcreteType guaranteedType =
+ typesInferrer.getConcreteReturnTypeOfElement(element);
+ if (guaranteedType != null) return guaranteedType;
+ }
+ return null;
+ });
+ }
+
/**
* Return the (inferred) guaranteed concrete type of [node] or null.
* [node] must be an AST node of [owner].

Powered by Google App Engine
This is Rietveld 408576698