Index: pkg/analyzer/lib/src/generated/error_verifier.dart |
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart |
index 2a71ac62d48573331c0f79db9bd36cb9fd2d3459..30a50cc3a9ffbc687a631c0ef2fb0959ad901305 100644 |
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart |
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart |
@@ -347,6 +347,13 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
} |
@override |
+ Object visitAssertInitializer(AssertInitializer node) { |
+ _checkForNonBoolExpression(node); |
+ _checkAssertMessage(node); |
+ return super.visitAssertInitializer(node); |
+ } |
+ |
+ @override |
Object visitAssertStatement(AssertStatement node) { |
_checkForNonBoolExpression(node); |
_checkAssertMessage(node); |
@@ -1295,11 +1302,11 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
} |
/** |
- * If the given assert [statement] specifies a message, verify that support |
+ * If the given [assertion] specifies a message, verify that support |
* for assertions with messages is enabled. |
*/ |
- void _checkAssertMessage(AssertStatement statement) { |
- Expression expression = statement.message; |
+ void _checkAssertMessage(Assertion assertion) { |
+ Expression expression = assertion.message; |
if (expression != null && !enableAssertMessage) { |
_errorReporter.reportErrorForNode( |
CompileTimeErrorCode.EXTRA_ARGUMENT_TO_ASSERT, expression); |
@@ -5163,13 +5170,13 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
} |
/** |
- * Verify that the given assert [statement] has either a 'bool' or |
- * '() -> bool' input. |
+ * Verify that the given [assertion] has either a 'bool' or '() -> bool' |
+ * condition. |
* |
* See [StaticTypeWarningCode.NON_BOOL_EXPRESSION]. |
*/ |
- void _checkForNonBoolExpression(AssertStatement statement) { |
- Expression expression = statement.condition; |
+ void _checkForNonBoolExpression(Assertion assertion) { |
+ Expression expression = assertion.condition; |
DartType type = getStaticType(expression); |
if (type is InterfaceType) { |
if (!_typeSystem.isAssignableTo(type, _boolType)) { |