Chromium Code Reviews| Index: lib/compiler/implementation/elements/elements.dart |
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart |
| index e7fd419fe8e40f786ddeb86a9f6bb3045cb97802..943d5225cf8b3d2400a8d9a377abbc5a466adfc0 100644 |
| --- a/lib/compiler/implementation/elements/elements.dart |
| +++ b/lib/compiler/implementation/elements/elements.dart |
| @@ -333,11 +333,20 @@ class PrefixElement extends Element { |
| } |
| class TypedefElement extends Element { |
| - Token token; |
| + final Token token; |
| + Type cachedType; |
| + |
| TypedefElement(SourceString name, Element enclosing, this.token) |
| : super(name, ElementKind.TYPEDEF, enclosing); |
| position() => findMyName(token); |
| + |
| + Type computeType(Compiler compiler) { |
| + if (cachedType === null) { |
| + cachedType = new InterfaceType(name, this); |
|
ahe
2012/04/19 08:20:06
This could be set in the constructor.
karlklose
2012/04/25 11:45:43
Done.
|
| + } |
| + return cachedType; |
| + } |
| } |
| class VariableElement extends Element { |