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

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

Issue 10829168: Revert "Skeleton typedef type implementation" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »
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 35974e6885688d49e2af1f5cd9631450d89fce36..432d835a3f4c120c8dc82a4093bea074d2af20cf 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -432,34 +432,20 @@ class PrefixElement extends Element {
}
class TypedefElement extends Element implements TypeDeclarationElement {
+ Type cachedType;
Typedef cachedNode;
- TypedefType cachedType;
- Type alias;
TypedefElement(SourceString name, Element enclosing)
: super(name, ElementKind.TYPEDEF, enclosing);
- /**
- * Function signature for a typedef of a function type. The signature is
- * kept to provide full information about parameter names through the mirror
- * system.
- *
- * The [functionSignature] is not available until the typedef element has been
- * resolved.
- */
- FunctionSignature functionSignature;
-
- TypedefType computeType(Compiler compiler) {
- if (cachedType == null) {
- Typedef node = parseNode(compiler);
- Link<Type> parameters =
- TypeDeclarationElement.createTypeVariables(this, node.typeParameters);
- cachedType = new TypedefType(this, parameters);
- }
+ Type computeType(Compiler compiler) {
+ if (cachedType !== null) return cachedType;
+ cachedType = compiler.computeFunctionType(
+ this, compiler.resolveTypedef(this));
return cachedType;
}
- Link<Type> get typeVariables() => cachedType.typeArguments;
+ Link<Type> get typeVariables() => const EmptyLink<Type>();
Scope buildScope() =>
new TypeDeclarationScope(enclosingElement.buildScope(), this);
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698