Chromium Code Reviews| 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); |
| } |