| Index: pkg/analyzer/lib/src/error/codes.dart
|
| diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
|
| index 346daf9b92f49aeb554cfe93ff87f678d6702561..58e844c252a59d21ca935bca44e6aded6d396f1b 100644
|
| --- a/pkg/analyzer/lib/src/error/codes.dart
|
| +++ b/pkg/analyzer/lib/src/error/codes.dart
|
| @@ -639,6 +639,36 @@ class CompileTimeErrorCode extends ErrorCode {
|
| "In constant expressions, operands of this operator must be of type "
|
| "'num'.");
|
|
|
| + /**
|
| + * https://github.com/dart-lang/sdk/blob/master/docs/language/informal/assert-in-initializer-list.md
|
| + *
|
| + * During a const constructor invocation (that is, when the `const`
|
| + * constructor is invoked using the const prefix), if the assert fails,
|
| + * either due to boolean conversion when `r` is not a boolean value or due to
|
| + * assertion failure when `r` is `false`, it is treated like any other
|
| + * compile-time throw in a compile-time constant expression, and it causes
|
| + * a compile-time error.
|
| + */
|
| + static const CompileTimeErrorCode CONST_EVAL_THROWS_ASSERT_NOT_BOOL =
|
| + const CompileTimeErrorCode(
|
| + 'CONST_EVAL_THROWS_ASSERT_NOT_BOOL',
|
| + "In constant constructors the value of the condition of an assert "
|
| + "statement must be bool.");
|
| +
|
| + /**
|
| + * https://github.com/dart-lang/sdk/blob/master/docs/language/informal/assert-in-initializer-list.md
|
| + *
|
| + * During a const constructor invocation (that is, when the `const`
|
| + * constructor is invoked using the const prefix), if the assert fails,
|
| + * either due to boolean conversion when `r` is not a boolean value or due to
|
| + * assertion failure when `r` is `false`, it is treated like any other
|
| + * compile-time throw in a compile-time constant expression, and it causes
|
| + * a compile-time error.
|
| + */
|
| + static const CompileTimeErrorCode CONST_EVAL_THROWS_ASSERT_FALSE =
|
| + const CompileTimeErrorCode('CONST_EVAL_THROWS_ASSERT_FALSE',
|
| + "Evaluation of this constant expression throws an AssertionError.");
|
| +
|
| /**
|
| * 16.12.2 Const: It is a compile-time error if evaluation of a constant
|
| * object results in an uncaught exception being thrown.
|
|
|