diff --git a/packages/compiler-cli/src/diagnostics/expression_type.ts b/packages/compiler-cli/src/diagnostics/expression_type.ts index 85a7ce93ed..abf2613cf7 100644 --- a/packages/compiler-cli/src/diagnostics/expression_type.ts +++ b/packages/compiler-cli/src/diagnostics/expression_type.ts @@ -304,6 +304,10 @@ export class AstType implements AstVisitor { } visitPrefixNot(ast: PrefixNot) { + // If we are producing diagnostics, visit the children + if (this.diagnostics) { + visitAstChildren(ast, this); + } // The type of a prefix ! is always boolean. return this.query.getBuiltinType(BuiltinType.Boolean); } diff --git a/packages/compiler-cli/test/diagnostics/expression_diagnostics_spec.ts b/packages/compiler-cli/test/diagnostics/expression_diagnostics_spec.ts index 371c913135..2b7c581407 100644 --- a/packages/compiler-cli/test/diagnostics/expression_diagnostics_spec.ts +++ b/packages/compiler-cli/test/diagnostics/expression_diagnostics_spec.ts @@ -98,6 +98,9 @@ describe('expression diagnostics', () => { () => reject( '