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

Unified Diff: pkg/compiler/lib/src/world.dart

Issue 2917653002: Use failedAt in more places (Closed)
Patch Set: Created 3 years, 7 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 | « pkg/compiler/lib/src/resolution/tree_elements.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/world.dart
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index 10f538ad06bcc024e1f1ef11784d88f6309a0846..59e009558ed7f1ed8909992d296181d3814a5329 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -1171,19 +1171,17 @@ class ClosedWorldImpl extends ClosedWorldBase {
bool _checkEntity(Element element) => element.isDeclaration;
bool _checkInvariants(ClassElement cls, {bool mustBeInstantiated: true}) {
- return invariant(cls, cls.isDeclaration,
- message: '$cls must be the declaration.') &&
- invariant(cls, cls.isResolved,
- message:
- '$cls must be resolved.') /* &&
- // TODO(johnniwinther): Reinsert this or similar invariant. Currently
- // various call sites use uninstantiated classes for isSubtypeOf or
- // isSubclassOf. Some are valid, some are not. Work out better invariants
- // to catch the latter.
- (!mustBeInstantiated ||
- invariant(cls, isInstantiated(cls),
- message: '$cls is not instantiated.'))*/
- ;
+ assert(cls.isDeclaration, failedAt(cls, '$cls must be the declaration.'));
+ assert(cls.isResolved, failedAt(cls, '$cls must be resolved.'));
+
+ // TODO(johnniwinther): Reinsert this or similar invariant. Currently
+ // various call sites use uninstantiated classes for isSubtypeOf or
+ // isSubclassOf. Some are valid, some are not. Work out better invariants
+ // to catch the latter.
+ // if (mustBeInstantiated) {
+ // assert(isInstantiated(cls), failedAt(cls, '$cls is not instantiated.'));
+ // }
+ return true;
}
OrderedTypeSet _getOrderedTypeSet(ClassElement cls) =>
« no previous file with comments | « pkg/compiler/lib/src/resolution/tree_elements.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698