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
This commit is contained in:
Daniel Trevino 2021-08-04 16:46:05 +00:00 committed by Andrew Kushnir
parent 3a092d6cea
commit c055cfe281
2 changed files with 4 additions and 4 deletions

View File

@ -168,9 +168,9 @@ export interface TemplateTypeChecker {
/**
* Constructs a `ts.Diagnostic` for a given `ParseSourceSpan` within a template.
*/
makeTemplateDiagnostic(
makeTemplateDiagnostic<T extends ErrorCode>(
clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory,
errorCode: ErrorCode, message: string, relatedInformation?: {
errorCode: T, message: string, relatedInformation?: {
text: string,
start: number,
end: number,

View File

@ -309,9 +309,9 @@ export class TemplateTypeCheckerImpl implements TemplateTypeChecker {
this.isComplete = false;
}
makeTemplateDiagnostic(
makeTemplateDiagnostic<T extends ErrorCode>(
clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory,
errorCode: ErrorCode, message: string, relatedInformation?: {
errorCode: T, message: string, relatedInformation?: {
text: string,
start: number,
end: number,