mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #20374 from uniqueiniquity/symlinkTypeReferenceDirective
Handle failure to properly resolve type reference directives
This commit is contained in:
@@ -25929,7 +25929,7 @@ namespace ts {
|
||||
// populate reverse mapping: file path -> type reference directive that was resolved to this file
|
||||
fileToDirective = createMap<string>();
|
||||
resolvedTypeReferenceDirectives.forEach((resolvedDirective, key) => {
|
||||
if (!resolvedDirective) {
|
||||
if (!resolvedDirective || !resolvedDirective.resolvedFileName) {
|
||||
return;
|
||||
}
|
||||
const file = host.getSourceFile(resolvedDirective.resolvedFileName);
|
||||
|
||||
@@ -794,6 +794,7 @@ namespace ts {
|
||||
if (traceEnabled) {
|
||||
trace(host, Diagnostics.Resolving_real_path_for_0_result_1, path, real);
|
||||
}
|
||||
Debug.assert(host.fileExists(real), `${path} linked to nonexistent file ${real}`); // tslint:disable-line
|
||||
return real;
|
||||
}
|
||||
|
||||
|
||||
@@ -2779,7 +2779,7 @@ namespace ts {
|
||||
getCompilerOptions(): CompilerOptions;
|
||||
|
||||
getSourceFiles(): ReadonlyArray<SourceFile>;
|
||||
getSourceFile(fileName: string): SourceFile;
|
||||
getSourceFile(fileName: string): SourceFile | undefined;
|
||||
getResolvedTypeReferenceDirectives(): ReadonlyMap<ResolvedTypeReferenceDirective>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user