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

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

Issue 10115026: Address the remaining review comments on http://chromiumcodereview.appspot.com/9431029. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Break a long line. Created 8 years, 8 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: 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.

Powered by Google App Engine
This is Rietveld 408576698