Fixed crash related to creating file diagnostics outside of the source file range in checkPotentialUncheckedRenamedBindingElementsInTypes (#59428)

This commit is contained in:
Mateusz Burzyński
2024-07-29 13:31:16 -07:00
committed by GitHub
parent 2daa5027a3
commit 68648256f8
7 changed files with 140 additions and 1 deletions

View File

@@ -43552,7 +43552,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// entire parameter does not have type annotation, suggest adding an annotation
addRelatedInfo(
diagnostic,
createFileDiagnostic(getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 1, Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, declarationNameToString(node.propertyName)),
createFileDiagnostic(getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 0, Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, declarationNameToString(node.propertyName)),
);
}
diagnostics.add(diagnostic);