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:
parent
3a092d6cea
commit
c055cfe281
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue