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

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

Issue 10834061: Resolve typedefs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | « no previous file | lib/compiler/implementation/resolver.dart » ('j') | lib/compiler/implementation/resolver.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/elements/elements.dart
diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
index 01dc5707385cb7b796a6e953e8bced1569a4e765..b5944249c990aeaf766f8a38208e33bf438a8f15 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -38,7 +38,7 @@ class ElementCategory {
static final int IMPLIES_TYPE = CLASS | ALIAS | TYPE_VARIABLE;
- static final int IS_EXTENDABLE = CLASS | ALIAS;
+ static final int IS_EXTENDABLE = CLASS;
}
class ElementKind {
@@ -198,6 +198,14 @@ class Element implements Hashable {
return null;
}
+ Element getEnclosingClassOrTypedef() {
+ for (Element e = this; e !== null; e = e.enclosingElement) {
+ if (e.kind === ElementKind.CLASS
+ || e.kind === ElementKind.TYPEDEF) return e;
ahe 2012/07/30 10:30:05 I'd prefer if you keep the condition on the same l
Johnni Winther 2012/08/01 10:12:28 Removed.
+ }
+ return null;
+ }
+
Element getEnclosingMember() {
for (Element e = this; e !== null; e = e.enclosingElement) {
if (e.isMember()) return e;
@@ -419,16 +427,18 @@ class PrefixElement extends Element {
}
class TypedefElement extends Element {
+ TypedefElement(SourceString name, Element enclosing)
+ : typeParameters = new LinkedHashMap<SourceString, TypeVariableElement>(),
+ super(name, ElementKind.TYPEDEF, enclosing);
+
+ LinkedHashMap<SourceString, TypeVariableElement> typeParameters;
ahe 2012/07/30 10:30:05 I don't think this should be a map. The overhead o
Johnni Winther 2012/08/01 10:12:28 Done.
+
Type cachedType;
Typedef cachedNode;
- TypedefElement(SourceString name, Element enclosing)
- : super(name, ElementKind.TYPEDEF, enclosing);
-
Type computeType(Compiler compiler) {
if (cachedType !== null) return cachedType;
- cachedType = compiler.computeFunctionType(
- this, compiler.resolveTypedef(this));
+ compiler.resolveTypedef(this);
ahe 2012/07/30 10:30:05 This method may be called twice. You need to ensur
Johnni Winther 2012/08/01 10:12:28 Done.
return cachedType;
}
}
« no previous file with comments | « no previous file | lib/compiler/implementation/resolver.dart » ('j') | lib/compiler/implementation/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698