Chromium Code Reviews| Index: lib/compiler/implementation/resolver.dart |
| diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart |
| index 1b6a82d6820d2a43a6151d68aa3a3b4fabc8e349..f56fc353ec278297a6ecd2e3145ca9b5d54c5baf 100644 |
| --- a/lib/compiler/implementation/resolver.dart |
| +++ b/lib/compiler/implementation/resolver.dart |
| @@ -1107,13 +1107,15 @@ class ResolverVisitor extends CommonResolverVisitor<Element> { |
| report(node.typeArguments, MessageKind.MISSING_TYPE_ARGUMENT); |
| } |
| } |
| - type = new InterfaceType(cls.name, cls, arguments.toLink()); |
| - } else if (element.isTypedef()) { |
| - // TODO(karlklose): implement typedefs. We return a fake type that the |
| - // code generator can use to detect typedefs in is-checks. |
| - type = new InterfaceType(element.name, element); |
| - } else { |
| + if (arguments.length == 0) { |
| + type = element.computeType(compiler); |
|
ahe
2012/04/19 08:20:06
I think you have a different design in mind than t
karlklose
2012/04/25 11:45:43
As discussed, the check must be on the number of t
|
| + } else { |
| + type = new InterfaceType(cls.name, cls, arguments.toLink()); |
| + } |
| + } else if (element.isTypedef() || element.isTypeVariable()) { |
| type = element.computeType(compiler); |
| + } else { |
| + compiler.internalErrorOnElement(element, "unexpected element kind"); |
| } |
| } |
| return useType(node, type); |
| @@ -1741,17 +1743,7 @@ class SignatureResolver extends CommonResolverVisitor<Element> { |
| // TODO(ahe): This is temporary. |
| void resolveType(Node node) { |
| if (node == null) return; |
| - // Find the correct member context to perform the lookup in. |
| - Element outer = enclosingElement; |
| - Element context = outer; |
| - while (outer !== null) { |
| - if (outer.isMember()) { |
| - context = outer; |
| - break; |
| - } |
| - outer = outer.enclosingElement; |
| - } |
| - node.accept(new ResolverVisitor(compiler, context)); |
| + node.accept(new ResolverVisitor(compiler, enclosingElement)); |
| } |
| // TODO(ahe): This is temporary. |