From c055cfe281c9c57a21de155b8a6b3330dd288bc2 Mon Sep 17 00:00:00 2001 From: Daniel Trevino <23410540+danieltre23@users.noreply.github.com> Date: Wed, 4 Aug 2021 16:46:05 +0000 Subject: [PATCH] refactor(compiler-cli): make `makeTemplateDiagnostic` wrapper error (#42984) specific This commit makes the wrapper function `makeTemplateDiagnostic` take an ErrorCode as a type for the `ts.Diagnostic`s to be generated. Refs #42966 PR Close #42984 --- packages/compiler-cli/src/ngtsc/typecheck/api/checker.ts | 4 ++-- packages/compiler-cli/src/ngtsc/typecheck/src/checker.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/compiler-cli/src/ngtsc/typecheck/api/checker.ts b/packages/compiler-cli/src/ngtsc/typecheck/api/checker.ts index c8b60f410d..2354b85cf8 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/api/checker.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/api/checker.ts @@ -168,9 +168,9 @@ export interface TemplateTypeChecker { /** * Constructs a `ts.Diagnostic` for a given `ParseSourceSpan` within a template. */ - makeTemplateDiagnostic( + makeTemplateDiagnostic( clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory, - errorCode: ErrorCode, message: string, relatedInformation?: { + errorCode: T, message: string, relatedInformation?: { text: string, start: number, end: number, diff --git a/packages/compiler-cli/src/ngtsc/typecheck/src/checker.ts b/packages/compiler-cli/src/ngtsc/typecheck/src/checker.ts index 504314d6bf..2596222aa0 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/src/checker.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/src/checker.ts @@ -309,9 +309,9 @@ export class TemplateTypeCheckerImpl implements TemplateTypeChecker { this.isComplete = false; } - makeTemplateDiagnostic( + makeTemplateDiagnostic( clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory, - errorCode: ErrorCode, message: string, relatedInformation?: { + errorCode: T, message: string, relatedInformation?: { text: string, start: number, end: number,