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

Unified Diff: pkg/compiler/lib/src/resolution/class_members.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/parser/partial_elements.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/class_members.dart
diff --git a/pkg/compiler/lib/src/resolution/class_members.dart b/pkg/compiler/lib/src/resolution/class_members.dart
index acf7885d7ea53dd6cd8c902af99b1442ec712bac..b99732adc328317fb315ceb064a6c4a6e5a50290 100644
--- a/pkg/compiler/lib/src/resolution/class_members.dart
+++ b/pkg/compiler/lib/src/resolution/class_members.dart
@@ -34,8 +34,8 @@ abstract class MembersCreator {
MembersCreator(
this.resolution, this.cls, this.computedMemberNames, this.classMembers) {
- assert(invariant(cls, cls.isDeclaration,
- message: "Members may only be computed on declarations."));
+ assert(cls.isDeclaration,
+ failedAt(cls, "Members may only be computed on declarations."));
}
DiagnosticReporter get reporter => resolution.reporter;
@@ -213,7 +213,7 @@ abstract class MembersCreator {
name = name.setter;
addDeclaredMember(name, type, functionType);
} else {
- assert(invariant(element, element.isFunction));
+ assert(element.isFunction, failedAt(element));
ResolutionFunctionType type = element.computeType(resolution);
addDeclaredMember(name, type, type);
}
@@ -366,8 +366,8 @@ abstract class MembersCreator {
for (Member inherited in superMember.declarations) {
if (cls == inherited.declarer.element) {
// An error should already have been reported.
- assert(invariant(
- declared.element, resolution.reporter.hasReportedError));
+ assert(resolution.reporter.hasReportedError,
+ failedAt(declared.element));
continue;
}
@@ -389,9 +389,11 @@ abstract class MembersCreator {
} else if (cls == inherited.declarer.element) {
// An error should already have been reported.
assert(
- invariant(declared.element, resolution.reporter.hasReportedError,
- message: "Member $inherited inherited from its "
- "declaring class: ${cls}."));
+ resolution.reporter.hasReportedError,
+ failedAt(
+ declared.element,
+ "Member $inherited inherited from its "
+ "declaring class: ${cls}."));
continue;
}
« no previous file with comments | « pkg/compiler/lib/src/parser/partial_elements.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698