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

Unified Diff: pkg/compiler/lib/src/resolution/constructors.dart

Issue 2905463003: 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
Index: pkg/compiler/lib/src/resolution/constructors.dart
diff --git a/pkg/compiler/lib/src/resolution/constructors.dart b/pkg/compiler/lib/src/resolution/constructors.dart
index 87caf5b464de43df1849ef039fb1e5669e1db810..64b65d1536a9b6ba6d5e899c6a33b282dce467f8 100644
--- a/pkg/compiler/lib/src/resolution/constructors.dart
+++ b/pkg/compiler/lib/src/resolution/constructors.dart
@@ -568,8 +568,8 @@ class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> {
ConstructorResultKind.GENERATIVE, prefix, constructor, type);
}
} else {
- assert(invariant(diagnosticNode, constructor.isFactoryConstructor,
- message: "Unexpected constructor $constructor."));
+ assert(constructor.isFactoryConstructor,
+ failedAt(diagnosticNode, "Unexpected constructor $constructor."));
return new ConstructorResult(
ConstructorResultKind.FACTORY, prefix, constructor, type);
}
@@ -579,8 +579,8 @@ class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> {
ConstructorResult visitNewExpression(NewExpression node) {
Node selector = node.send.selector;
ConstructorResult result = visit(selector);
- assert(invariant(selector, result != null,
- message: 'No result returned for $selector.'));
+ assert(result != null,
+ failedAt(selector, 'No result returned for $selector.'));
return finishConstructorReference(result, node.send.selector, node);
}
@@ -588,8 +588,8 @@ class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> {
/// type of the constructed instance on [expression].
ConstructorResult finishConstructorReference(
ConstructorResult result, Node diagnosticNode, Node expression) {
- assert(invariant(diagnosticNode, result != null,
- message: 'No result returned for $diagnosticNode.'));
+ assert(result != null,
+ failedAt(diagnosticNode, 'No result returned for $diagnosticNode.'));
if (result.kind != null) {
resolver.registry.setType(expression, result.type);
@@ -642,11 +642,11 @@ class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> {
ConstructorResult visitSend(Send node) {
ConstructorResult receiver = visit(node.receiver);
- assert(invariant(node.receiver, receiver != null,
- message: 'No result returned for $node.receiver.'));
+ assert(receiver != null,
+ failedAt(node.receiver, 'No result returned for $node.receiver.'));
if (receiver.kind != null) {
- assert(invariant(node, receiver.element.isMalformed,
- message: "Unexpected prefix result: $receiver."));
+ assert(receiver.element.isMalformed,
+ failedAt(node, "Unexpected prefix result: $receiver."));
// We have already found an error.
return receiver;
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_members.dart ('k') | pkg/compiler/lib/src/resolution/member_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698