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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12211112: Start work on a non-complete type inferrer. Currently only analyzes return types. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 DartType getType(Node node); 10 DartType getType(Node node);
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1830 SourceString name; 1830 SourceString name;
1831 if (node.name == null) { 1831 if (node.name == null) {
1832 name = const SourceString(""); 1832 name = const SourceString("");
1833 } else { 1833 } else {
1834 name = node.name.asIdentifier().source; 1834 name = node.name.asIdentifier().source;
1835 } 1835 }
1836 1836
1837 FunctionElement function = new FunctionElementX.node( 1837 FunctionElement function = new FunctionElementX.node(
1838 name, node, ElementKind.FUNCTION, Modifiers.EMPTY, 1838 name, node, ElementKind.FUNCTION, Modifiers.EMPTY,
1839 enclosingElement); 1839 enclosingElement);
1840 // [function] and its enclosing method share the same
1841 // [TreeElementMapping].
1842 compiler.enqueuer.resolution.resolvedElements[function] = mapping;
1840 Scope oldScope = scope; // The scope is modified by [setupFunction]. 1843 Scope oldScope = scope; // The scope is modified by [setupFunction].
1841 setupFunction(node, function); 1844 setupFunction(node, function);
1842 defineElement(node, function, doAddToScope: node.name != null); 1845 defineElement(node, function, doAddToScope: node.name != null);
1843 1846
1844 Element previousEnclosingElement = enclosingElement; 1847 Element previousEnclosingElement = enclosingElement;
1845 enclosingElement = function; 1848 enclosingElement = function;
1846 // Run the body in a fresh statement scope. 1849 // Run the body in a fresh statement scope.
1847 StatementScope oldStatementScope = statementScope; 1850 StatementScope oldStatementScope = statementScope;
1848 statementScope = new StatementScope(); 1851 statementScope = new StatementScope();
1849 visit(node.body); 1852 visit(node.body);
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
3654 return e; 3657 return e;
3655 } 3658 }
3656 3659
3657 /// Assumed to be called by [resolveRedirectingFactory]. 3660 /// Assumed to be called by [resolveRedirectingFactory].
3658 Element visitReturn(Return node) { 3661 Element visitReturn(Return node) {
3659 Node expression = node.expression; 3662 Node expression = node.expression;
3660 return finishConstructorReference(visit(expression), 3663 return finishConstructorReference(visit(expression),
3661 expression, expression); 3664 expression, expression);
3662 } 3665 }
3663 } 3666 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698