| Index: pkg/compiler/lib/src/constants/evaluation.dart
|
| diff --git a/pkg/compiler/lib/src/constants/evaluation.dart b/pkg/compiler/lib/src/constants/evaluation.dart
|
| index a799d17254aca5d2e5a8fede04e928872b2ee029..d94e5528b6e010e8c7ae446aa523fcba94dc139f 100644
|
| --- a/pkg/compiler/lib/src/constants/evaluation.dart
|
| +++ b/pkg/compiler/lib/src/constants/evaluation.dart
|
| @@ -48,14 +48,18 @@ class NormalizedArguments {
|
| int index = callStructure.namedArguments.indexOf(name);
|
| if (index == -1) {
|
| // The named argument is not provided.
|
| - invariant(CURRENT_ELEMENT_SPANNABLE, defaultValues[name] != null,
|
| - message: "No default value for named argument '$name' in $this.");
|
| + assert(
|
| + defaultValues[name] != null,
|
| + failedAt(CURRENT_ELEMENT_SPANNABLE,
|
| + "No default value for named argument '$name' in $this."));
|
| return defaultValues[name];
|
| }
|
| ConstantExpression value =
|
| arguments[index + callStructure.positionalArgumentCount];
|
| - invariant(CURRENT_ELEMENT_SPANNABLE, value != null,
|
| - message: "No value for named argument '$name' in $this.");
|
| + assert(
|
| + value != null,
|
| + failedAt(CURRENT_ELEMENT_SPANNABLE,
|
| + "No value for named argument '$name' in $this."));
|
| return value;
|
| }
|
|
|
| @@ -63,13 +67,17 @@ class NormalizedArguments {
|
| ConstantExpression getPositionalArgument(int index) {
|
| if (index >= callStructure.positionalArgumentCount) {
|
| // The positional argument is not provided.
|
| - invariant(CURRENT_ELEMENT_SPANNABLE, defaultValues[index] != null,
|
| - message: "No default value for positional argument $index in $this.");
|
| + assert(
|
| + defaultValues[index] != null,
|
| + failedAt(CURRENT_ELEMENT_SPANNABLE,
|
| + "No default value for positional argument $index in $this."));
|
| return defaultValues[index];
|
| }
|
| ConstantExpression value = arguments[index];
|
| - invariant(CURRENT_ELEMENT_SPANNABLE, value != null,
|
| - message: "No value for positional argument $index in $this.");
|
| + assert(
|
| + value != null,
|
| + failedAt(CURRENT_ELEMENT_SPANNABLE,
|
| + "No value for positional argument $index in $this."));
|
| return value;
|
| }
|
|
|
|
|