Chromium Code Reviews| Index: lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| index 14a2674167a5b74b88b90235c2352e09b1cd4951..44aeddecc6799d49750a5646bb1087080d366fb7 100644 |
| --- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| +++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| @@ -442,16 +442,6 @@ class PlaceholderCollector extends AbstractVisitor { |
| assert(currentElement is ClassElement); |
| makeElementPlaceholder(node.name, currentElement); |
| node.visitChildren(this); |
| - if (node.typeParameters !== null) { |
| - // Another poor man resolution. |
| - final typeVariableTypes = |
| - new List<Type>.from(currentElement.typeVariables); |
| - int i = 0; |
| - for (TypeVariable typeVariable in node.typeParameters) { |
| - makeTypePlaceholder(typeVariable.name, typeVariableTypes[i]); |
| - i++; |
| - } |
| - } |
| if (node.defaultClause !== null) { |
| // Can't just visit class node's default clause because of the bug in the |
| // resolver, it just crashes when it meets type variable. |
| @@ -462,6 +452,19 @@ class PlaceholderCollector extends AbstractVisitor { |
| } |
| } |
| + visitTypeVariable(TypeVariable node) { |
|
Anton Muhin
2012/08/22 12:34:53
it fixes a case with typedefs too?
Roman
2012/08/22 12:38:22
Yes, there's a test for it in unparser_test. At fi
|
| + assert(currentElement is TypedefElement || currentElement is ClassElement); |
| + // Another poor man type resolution. |
| + // Find this variable in current element type parameters. |
| + for (Type type in currentElement.typeVariables) { |
| + if (type.name.slowToString() == node.name.source.slowToString()) { |
| + makeTypePlaceholder(node.name, type); |
| + break; |
| + } |
| + } |
| + node.visitChildren(this); |
| + } |
| + |
| visitTypedef(Typedef node) { |
| assert(currentElement is TypedefElement); |
| makeElementPlaceholder(node.name, currentElement); |