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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 15911008: Set the supertype to avoid loop. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « no previous file | dart/tests/language/cyclic_class_member_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 135da9d66648e194a93197b49462b9738c5eb7ac..d0ffd9a7699e69a850c3d65afc99d721f6b505fd 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -485,8 +485,7 @@ class ResolverTask extends CompilerTask {
cls.supertypeLoadState = STATE_DONE;
cls.allSupertypes = const Link<DartType>().prepend(
compiler.objectClass.computeType(compiler));
- // TODO(ahe): We should also set cls.supertype here to avoid
- // creating a malformed class hierarchy.
+ cls.supertype = cls.allSupertypes.head;
return;
}
cls.supertypeLoadState = STATE_STARTED;
@@ -3234,9 +3233,9 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
// resolve this class again.
resolveTypeVariableBounds(node.typeParameters);
- // Setup the supertype for the element.
- assert(element.supertype == null);
- if (node.superclass != null) {
+ // Setup the supertype for the element (if there is a cycle in the
+ // class hierarchy, it has already been set to Object).
+ if (element.supertype == null && node.superclass != null) {
MixinApplication superMixin = node.superclass.asMixinApplication();
if (superMixin != null) {
DartType supertype = resolveSupertype(element, superMixin.superclass);
« no previous file with comments | « no previous file | dart/tests/language/cyclic_class_member_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698