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

Unified Diff: pkg/compiler/lib/src/universe/codegen_world_builder.dart

Issue 2900263002: Use failedAt in more places (constants, universe) (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
Index: pkg/compiler/lib/src/universe/codegen_world_builder.dart
diff --git a/pkg/compiler/lib/src/universe/codegen_world_builder.dart b/pkg/compiler/lib/src/universe/codegen_world_builder.dart
index c135e726d8d9370123c8e60255f980831f032c15..d937594b74bf1e0b939c6dea2028c5f591dd876b 100644
--- a/pkg/compiler/lib/src/universe/codegen_world_builder.dart
+++ b/pkg/compiler/lib/src/universe/codegen_world_builder.dart
@@ -514,7 +514,7 @@ class ElementCodegenWorldBuilderImpl extends CodegenWorldBuilderImpl {
@override
void _processInstantiatedClassMember(
ClassEntity cls, MemberElement member, MemberUsedCallback memberUsed) {
- assert(invariant(member, member.isDeclaration));
+ assert(member.isDeclaration, failedAt(member));
if (member.isMalformed) return;
super._processInstantiatedClassMember(cls, member, memberUsed);
}
@@ -522,14 +522,14 @@ class ElementCodegenWorldBuilderImpl extends CodegenWorldBuilderImpl {
@override
_MemberUsage _getMemberUsage(
MemberElement member, MemberUsedCallback memberUsed) {
- assert(invariant(member, member.isDeclaration));
+ assert(member.isDeclaration, failedAt(member));
return super._getMemberUsage(member, memberUsed);
}
void registerStaticUse(StaticUse staticUse, MemberUsedCallback memberUsed) {
Element element = staticUse.element;
- assert(invariant(element, element.isDeclaration,
- message: "Element ${element} is not the declaration."));
+ assert(element.isDeclaration,
+ failedAt(element, "Element ${element} is not the declaration."));
super.registerStaticUse(staticUse, memberUsed);
}

Powered by Google App Engine
This is Rietveld 408576698