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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12377081: Register instantiated types instead of instantiated classes in the resolver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Small bugfix: use the raw type if no type argument is given. Created 7 years, 10 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f9570833b40a4f0e804fec2c270f16adaed9aa33..59a86071fc9bc9e8f0bc846012a46ac03c54d9e1 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -2591,20 +2591,28 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
}
visitLiteralList(LiteralList node) {
- world.registerInstantiatedClass(compiler.listClass);
NodeList arguments = node.typeArguments;
+ DartType typeArgument;
if (arguments != null) {
Link<Node> nodes = arguments.nodes;
if (nodes.isEmpty) {
error(arguments, MessageKind.MISSING_TYPE_ARGUMENT);
} else {
- resolveTypeRequired(nodes.head);
+ typeArgument = resolveTypeRequired(nodes.head);
for (nodes = nodes.tail; !nodes.isEmpty; nodes = nodes.tail) {
error(nodes.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT);
resolveTypeRequired(nodes.head);
}
}
}
+ DartType listType;
+ if (typeArgument != null) {
+ listType = new InterfaceType(compiler.listClass,
+ new Link<DartType>.fromList([typeArgument]));
+ } else {
+ listType = compiler.listClass.rawType;
+ }
+ world.registerInstantiatedType(listType);
visit(node.elements);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698