mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-07 17:26:48 -05:00
Avoid unnecessary resolution-mode assertion in declaration emit (#55727)
This commit is contained in:
@@ -47760,11 +47760,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
function addReferencedFilesToTypeDirective(file: SourceFile, key: string, mode: ResolutionMode) {
|
||||
if (fileToDirective.has(file.path)) return;
|
||||
fileToDirective.set(file.path, [key, mode]);
|
||||
for (const { fileName, resolutionMode } of file.referencedFiles) {
|
||||
for (const { fileName } of file.referencedFiles) {
|
||||
const resolvedFile = resolveTripleslashReference(fileName, file.fileName);
|
||||
const referencedFile = host.getSourceFile(resolvedFile);
|
||||
if (referencedFile) {
|
||||
addReferencedFilesToTypeDirective(referencedFile, key, resolutionMode || file.impliedNodeFormat);
|
||||
// The resolution mode of the file reference doesn't actually matter here -
|
||||
// all we're recording is the fact that the file entered the compilation
|
||||
// transitively via a type reference directive of {key} with mode {mode}.
|
||||
addReferencedFilesToTypeDirective(referencedFile, key, mode || file.impliedNodeFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user