| Index: pkg/compiler/lib/src/serialization/serialization_util.dart
|
| diff --git a/pkg/compiler/lib/src/serialization/serialization_util.dart b/pkg/compiler/lib/src/serialization/serialization_util.dart
|
| index ef8780be8843f9215c2d01d983fd82c03faa2595..f044f73743f82fdce54fe98a32f6acad93786b5b 100644
|
| --- a/pkg/compiler/lib/src/serialization/serialization_util.dart
|
| +++ b/pkg/compiler/lib/src/serialization/serialization_util.dart
|
| @@ -488,8 +488,11 @@ void serializeElementReference(Element context, Key elementKey, Key nameKey,
|
| ObjectEncoder encoder, Element element) {
|
| if (element.isGenerativeConstructor &&
|
| element.enclosingClass.isUnnamedMixinApplication) {
|
| - assert(invariant(element, element.isConstructor,
|
| - message: "Unexpected reference of forwarding constructor "
|
| + assert(
|
| + element.isConstructor,
|
| + failedAt(
|
| + element,
|
| + "Unexpected reference of forwarding constructor "
|
| "${element} from $context."));
|
| encoder.setString(nameKey, element.name);
|
| } else {
|
| @@ -512,20 +515,29 @@ Element deserializeElementReference(
|
| }
|
| ClassElement cls;
|
| if (context is ClassElement) {
|
| - assert(invariant(NO_LOCATION_SPANNABLE, context.isNamedMixinApplication,
|
| - message: "Unexpected reference of forwarding constructor "
|
| + assert(
|
| + context.isNamedMixinApplication,
|
| + failedAt(
|
| + NO_LOCATION_SPANNABLE,
|
| + "Unexpected reference of forwarding constructor "
|
| "'${elementName}' from $context."));
|
| cls = context;
|
| } else {
|
| - assert(invariant(NO_LOCATION_SPANNABLE, context.isConstructor,
|
| - message: "Unexpected reference of forwarding constructor "
|
| + assert(
|
| + context.isConstructor,
|
| + failedAt(
|
| + NO_LOCATION_SPANNABLE,
|
| + "Unexpected reference of forwarding constructor "
|
| "'${elementName}' from $context."));
|
| cls = context.enclosingClass;
|
| }
|
| ClassElement superclass = cls.superclass;
|
| element = superclass.lookupConstructor(elementName);
|
| - assert(invariant(NO_LOCATION_SPANNABLE, element != null,
|
| - message: "Unresolved reference of forwarding constructor "
|
| + assert(
|
| + element != null,
|
| + failedAt(
|
| + NO_LOCATION_SPANNABLE,
|
| + "Unresolved reference of forwarding constructor "
|
| "'${elementName}' from $context."));
|
| }
|
| return element;
|
|
|