Chromium Code Reviews| Index: lib/compiler/implementation/elements/elements.dart |
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart |
| index 498bad83e06c16d1248ffdd84ac9eacf253d3d01..91106d17eaf7fb39e192d2b2164ecc37173376fd 100644 |
| --- a/lib/compiler/implementation/elements/elements.dart |
| +++ b/lib/compiler/implementation/elements/elements.dart |
| @@ -619,21 +619,23 @@ class FunctionElement extends Element { |
| FunctionType computeType(Compiler compiler) { |
| if (type != null) return type; |
| - FunctionParameters parameters = computeParameters(compiler); |
| - Types types = compiler.types; |
| - FunctionExpression node = |
| - compiler.parser.measure(() => parseNode(compiler)); |
| - Type returnType = getType(node.returnType, compiler, getLibrary()); |
| - if (returnType === null) returnType = types.dynamicType; |
| - |
| - LinkBuilder<Type> parameterTypes = new LinkBuilder<Type>(); |
| - for (Link<Element> link = parameters.requiredParameters; |
| - !link.isEmpty(); |
| - link = link.tail) { |
| - parameterTypes.addLast(link.head.computeType(compiler)); |
| - } |
| - type = new FunctionType(returnType, parameterTypes.toLink(), this); |
| - return type; |
| + return compiler.withCurrentElement(this, () { |
|
kasperl
2012/04/23 11:45:45
Would it be possible to add a regression test case
|
| + FunctionParameters parameters = computeParameters(compiler); |
| + Types types = compiler.types; |
| + FunctionExpression node = |
| + compiler.parser.measure(() => parseNode(compiler)); |
| + Type returnType = getType(node.returnType, compiler, getLibrary()); |
| + if (returnType === null) returnType = types.dynamicType; |
| + |
| + LinkBuilder<Type> parameterTypes = new LinkBuilder<Type>(); |
| + for (Link<Element> link = parameters.requiredParameters; |
| + !link.isEmpty(); |
| + link = link.tail) { |
| + parameterTypes.addLast(link.head.computeType(compiler)); |
| + } |
| + type = new FunctionType(returnType, parameterTypes.toLink(), this); |
| + return type; |
| + }); |
| } |
| Node parseNode(DiagnosticListener listener) => cachedNode; |