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

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

Issue 422483002: Mix in [TreeElementMixin] only on nodes that need it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 4 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/typechecker.dart
diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart
index f0391fe957d3bb473ba0a5d4741404593ed6bec4..fc444065d00878ae79aeaa92d3ddc7e5044055d3 100644
--- a/sdk/lib/_internal/compiler/implementation/typechecker.dart
+++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart
@@ -579,7 +579,7 @@ class TypeCheckerVisitor extends Visitor<DartType> {
DartType type;
DartType returnType;
DartType previousType;
- final FunctionElement element = elements[node];
+ final FunctionElement element = elements.getFunctionDefinition(node);
assert(invariant(node, element != null,
message: 'FunctionExpression with no element'));
if (Elements.isUnresolved(element)) return const DynamicType();
@@ -1558,6 +1558,12 @@ class TypeCheckerVisitor extends Visitor<DartType> {
return type;
}
+ DartType visitRedirectingFactoryBody(RedirectingFactoryBody node) {
+ // TODO(lrn): Typecheck the body. It must refer to the constructor
+ // of a subtype.
+ return StatementType.RETURNING;
+ }
+
DartType visitRethrow(Rethrow node) {
return StatementType.RETURNING;
}
@@ -1567,11 +1573,6 @@ class TypeCheckerVisitor extends Visitor<DartType> {
if (identical(node.beginToken.stringValue, 'native')) {
return StatementType.RETURNING;
}
- if (node.isRedirectingFactoryBody) {
- // TODO(lrn): Typecheck the body. It must refer to the constructor
- // of a subtype.
- return StatementType.RETURNING;
- }
final expression = node.expression;
final isVoidFunction = expectedReturnType.isVoid;

Powered by Google App Engine
This is Rietveld 408576698