Chromium Code Reviews| Index: lib/compiler/implementation/elements/elements.dart |
| =================================================================== |
| --- lib/compiler/implementation/elements/elements.dart (revision 11610) |
| +++ lib/compiler/implementation/elements/elements.dart (working copy) |
| @@ -722,27 +722,29 @@ |
| Type computeType(Compiler compiler) { |
| if (type != null) return type; |
| - VariableDefinitions node = parseNode(compiler); |
| - if (node.type !== null) { |
| - type = compiler.resolveTypeAnnotation(this, node.type); |
| - } else { |
| - // Is node.definitions exactly one FunctionExpression? |
| - Link<Node> link = node.definitions.nodes; |
| - if (!link.isEmpty() && |
| - link.head.asFunctionExpression() !== null && |
| - link.tail.isEmpty()) { |
| - FunctionExpression functionExpression = link.head; |
| - // We found exactly one FunctionExpression |
| - compiler.withCurrentElement(this, () { |
| - functionSignature = |
| - compiler.resolveFunctionExpression(this, functionExpression); |
| - }); |
| - type = compiler.computeFunctionType(compiler.functionClass, |
| - functionSignature); |
| + compiler.withCurrentElement(this, () { |
| + VariableDefinitions node = parseNode(compiler); |
| + if (node.type !== null) { |
| + type = compiler.resolveTypeAnnotation(this, node.type); |
| } else { |
| - type = compiler.types.dynamicType; |
| + // Is node.definitions exactly one FunctionExpression? |
| + Link<Node> link = node.definitions.nodes; |
| + if (!link.isEmpty() && |
| + link.head.asFunctionExpression() !== null && |
| + link.tail.isEmpty()) { |
| + FunctionExpression functionExpression = link.head; |
| + // We found exactly one FunctionExpression |
| + compiler.withCurrentElement(this, () { |
|
floitsch
2012/08/30 14:35:14
Is this still necessary?
ngeoffray
2012/08/30 17:10:21
Good catch.
|
| + functionSignature = |
| + compiler.resolveFunctionExpression(this, functionExpression); |
| + }); |
| + type = compiler.computeFunctionType(compiler.functionClass, |
| + functionSignature); |
| + } else { |
| + type = compiler.types.dynamicType; |
| + } |
| } |
| - } |
| + }); |
| assert(type != null); |
| return type; |
| } |