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

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

Issue 10917285: Stub implementation of patch invariants for the patch refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 years, 3 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/tree/nodes.dart ('k') | lib/compiler/implementation/universe/universe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « lib/compiler/implementation/tree/nodes.dart ('k') | lib/compiler/implementation/universe/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698