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

Unified Diff: dart/lib/compiler/implementation/resolver.dart

Issue 10441071: Use the typedef arity to know how to invoke a closure given by the dom. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 months 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
Index: dart/lib/compiler/implementation/resolver.dart
===================================================================
--- dart/lib/compiler/implementation/resolver.dart (revision 8049)
+++ dart/lib/compiler/implementation/resolver.dart (working copy)
@@ -1130,11 +1130,19 @@
type = new InterfaceType(cls, arguments.toLink());
}
} else if (element.isTypedef()) {
+ Typedef node = element.parseNode(compiler);
ahe 2012/05/29 12:32:08 Need to wrap this in compiler.withCurrentElement.
+
// 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.
+ LinkBuilder<Type> arguments = new LinkBuilder<Type>();
kasperl 2012/05/29 12:16:24 Factor this code out into a helper function with a
ngeoffray 2012/05/29 12:31:01 I moved the code to TypedefElement.computeType.
+ for (Link<Node> formals = node.formals.nodes;
ahe 2012/05/29 12:32:08 I'm really concerned about this approach. You need
ngeoffray 2012/05/29 13:06:28 Done.
+ !formals.isEmpty();
+ formals = formals.tail) {
+ arguments.addLast(compiler.types.dynamicType);
ahe 2012/05/29 12:32:08 Since you only build a list of dynamicType, you do
+ }
+
type = new FunctionType(compiler.types.dynamicType,
- const EmptyLink<Type>(),
+ arguments.toLink(),
element);
} else if (element.isTypeVariable()) {
type = element.computeType(compiler);

Powered by Google App Engine
This is Rietveld 408576698