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

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

Issue 10855125: Ensure supertypes are loaded safely. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: More cleanup of ClassElement.cloneMembersTo 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
Index: dart/lib/compiler/implementation/typechecker.dart
diff --git a/dart/lib/compiler/implementation/typechecker.dart b/dart/lib/compiler/implementation/typechecker.dart
index 290b68a73e5f58d783a688d94943537d26df3484..8918e9a7a5fed736cfd0fb888b00e08241e9b47a 100644
--- a/dart/lib/compiler/implementation/typechecker.dart
+++ b/dart/lib/compiler/implementation/typechecker.dart
@@ -93,11 +93,11 @@ class InterfaceType implements Type {
class FunctionType implements Type {
final Element element;
- final Type returnType;
- final Link<Type> parameterTypes;
+ Type returnType;
+ Link<Type> parameterTypes;
- const FunctionType(Type this.returnType, Link<Type> this.parameterTypes,
- Element this.element);
+ FunctionType(Type this.returnType, Link<Type> this.parameterTypes,
+ Element this.element);
toString() {
StringBuffer sb = new StringBuffer();
@@ -115,6 +115,13 @@ class FunctionType implements Type {
parameterTypes.forEach((_) { arity++; });
return arity;
}
+
+ void initializeFrom(FunctionType other) {
+ assert(returnType === null);
+ assert(parameterTypes === null);
+ returnType = other.returnType;
+ parameterTypes = other.parameterTypes;
+ }
}
class Types {

Powered by Google App Engine
This is Rietveld 408576698