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

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

Issue 11445043: Fix type annotations on local variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years 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
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 7818edd245ca366daa66a59b5e0d9e4b1d3602d5..39e9d5f5bc27f0ef29fb186171cc655bcae72e85 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -2060,10 +2060,18 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
}
visitVariableDefinitions(VariableDefinitions node) {
- visit(node.type);
VariableDefinitionsVisitor visitor =
new VariableDefinitionsVisitor(compiler, node, this,
ElementKind.VARIABLE);
+ // Ensure that we set the type of the [VariableListElement] since it depends
+ // the current scope. If the current scope is a [MethodScope] or
ngeoffray 2012/12/09 20:46:56 it depends *on* the current scope.
Johnni Winther 2012/12/11 14:22:58 Done in https://codereview.chromium.org/11415287/
+ // [BlockScope] it will not be available for the
+ // [VariableListElement.computeType] method.
+ if (node.type != null) {
+ visitor.variables.type = resolveTypeAnnotation(node.type);
+ } else {
+ visitor.variables.type = compiler.types.dynamicType;
+ }
visitor.visit(node.definitions);
}
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698