| Index: dart/lib/compiler/implementation/resolver.dart
|
| ===================================================================
|
| --- dart/lib/compiler/implementation/resolver.dart (revision 8049)
|
| +++ dart/lib/compiler/implementation/resolver.dart (working copy)
|
| @@ -237,6 +237,10 @@
|
| return measure(() => SignatureResolver.analyze(compiler, element));
|
| }
|
|
|
| + FunctionSignature resolveTypedef(TypedefElement element) {
|
| + return measure(() => SignatureResolver.analyzeTypedef(compiler, element));
|
| + }
|
| +
|
| error(Node node, MessageKind kind, [arguments = const []]) {
|
| ResolutionError message = new ResolutionError(kind, arguments);
|
| compiler.reportError(node, message);
|
| @@ -1130,12 +1134,7 @@
|
| type = new InterfaceType(cls, arguments.toLink());
|
| }
|
| } else if (element.isTypedef()) {
|
| - // TODO(ngeoffray): This is a hack to help us get support for the
|
| - // DOM library.
|
| - // TODO(ngeoffray): The list of types for the argument is wrong.
|
| - type = new FunctionType(compiler.types.dynamicType,
|
| - const EmptyLink<Type>(),
|
| - element);
|
| + type = element.computeType(compiler);
|
| } else if (element.isTypeVariable()) {
|
| type = element.computeType(compiler);
|
| } else {
|
| @@ -1776,6 +1775,23 @@
|
| returnType);
|
| }
|
|
|
| + static FunctionSignature analyzeTypedef(Compiler compiler,
|
| + TypedefElement element) {
|
| + Typedef node =
|
| + compiler.parser.measure(() => element.parseNode(compiler));
|
| + SignatureResolver visitor = new SignatureResolver(compiler, element);
|
| + Link<Node> nodes = node.formals.nodes;
|
| + LinkBuilder<Element> parametersBuilder = visitor.analyzeNodes(nodes);
|
| + Link<Element> parameters = parametersBuilder.toLink();
|
| + Type returnType =
|
| + compiler.resolveTypeAnnotation(element, node.returnType);
|
| + return new FunctionSignature(parameters,
|
| + visitor.optionalParameters,
|
| + parametersBuilder.length,
|
| + visitor.optionalParameterCount,
|
| + returnType);
|
| + }
|
| +
|
| // TODO(ahe): This is temporary.
|
| void resolveExpression(Node node) {
|
| if (node == null) return;
|
|
|