diff --git a/packages/compiler-cli/src/ngtsc/typecheck/src/expression.ts b/packages/compiler-cli/src/ngtsc/typecheck/src/expression.ts index e068cecb87..81fb098be2 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/src/expression.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/src/expression.ts @@ -234,8 +234,8 @@ class AstTranslator implements AstVisitor { return node; } - visitQuote(ast: Quote): never { - throw new Error('Method not implemented.'); + visitQuote(ast: Quote): ts.Expression { + return NULL_AS_ANY; } visitSafeMethodCall(ast: SafeMethodCall): ts.Expression { diff --git a/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts b/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts index e9586441c1..febe9c9e98 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts @@ -42,6 +42,11 @@ describe('type check blocks', () => { .toContain('(((ctx).a) ? ((ctx).b) : (((ctx).c) ? ((ctx).d) : ((ctx).e)))'); }); + it('should handle quote expressions as any type', () => { + const TEMPLATE = ``; + expect(tcb(TEMPLATE)).toContain('null as any'); + }); + it('should handle attribute values for directive inputs', () => { const TEMPLATE = `
`; const DIRECTIVES: TestDeclaration[] = [{