| Index: lib/compiler/implementation/typechecker.dart
|
| diff --git a/lib/compiler/implementation/typechecker.dart b/lib/compiler/implementation/typechecker.dart
|
| index 85e9cf39e6d5b6e9f7ec5918cb6d7b74364198b4..7ea62422f997c6d039c7c43db21894420f44c79d 100644
|
| --- a/lib/compiler/implementation/typechecker.dart
|
| +++ b/lib/compiler/implementation/typechecker.dart
|
| @@ -26,6 +26,15 @@ class TypeCheckerTask extends CompilerTask {
|
|
|
| abstract class DartType implements Hashable {
|
| abstract SourceString get name;
|
| + /**
|
| + * Returns the [Element] which declared this type.
|
| + *
|
| + * This can be [ClassElement] for classes, [TypedefElement] for typedefs,
|
| + * [TypeVariableElement] for type variables and [FunctionElement] for
|
| + * function types.
|
| + *
|
| + * Invariant: [element] must be a declaration element.
|
| + */
|
| abstract Element get element;
|
|
|
| /**
|
| @@ -154,7 +163,9 @@ class FunctionType implements DartType {
|
| Link<DartType> parameterTypes;
|
|
|
| FunctionType(DartType this.returnType, Link<DartType> this.parameterTypes,
|
| - Element this.element);
|
| + Element this.element) {
|
| + assert(element === null || invariant(element, element.isDeclaration));
|
| + }
|
|
|
| DartType unalias(Compiler compiler) => this;
|
|
|
|
|