@@ -4719,7 +4719,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4719
4719
);
4720
4720
}
4721
4721
else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) {
4722
- const redirect = host.getResolvedProjectReferenceToRedirect (sourceFile.path);
4722
+ const redirect = host.getRedirectFromSourceFile (sourceFile.path)?.resolvedRef ;
4723
4723
if (redirect) {
4724
4724
const ignoreCase = !host.useCaseSensitiveFileNames();
4725
4725
const ownRootDir = host.getCommonSourceDirectory();
@@ -4814,9 +4814,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4814
4814
if (moduleNotFoundError) {
4815
4815
// See if this was possibly a projectReference redirect
4816
4816
if (resolvedModule) {
4817
- const redirect = host.getProjectReferenceRedirect (resolvedModule.resolvedFileName);
4818
- if (redirect) {
4819
- error(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName);
4817
+ const redirect = host.getRedirectFromSourceFile (resolvedModule.resolvedFileName);
4818
+ if (redirect?.outputDts ) {
4819
+ error(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts , resolvedModule.resolvedFileName);
4820
4820
return undefined;
4821
4821
}
4822
4822
}
@@ -41530,7 +41530,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
41530
41530
) {
41531
41531
Debug.assert(!!(type.symbol.flags & SymbolFlags.ConstEnum));
41532
41532
const constEnumDeclaration = type.symbol.valueDeclaration as EnumDeclaration;
41533
- const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject (getSourceFileOfNode(constEnumDeclaration).resolvedPath);
41533
+ const redirect = host.getRedirectFromOutput (getSourceFileOfNode(constEnumDeclaration).resolvedPath)?.resolvedRef ;
41534
41534
if (constEnumDeclaration.flags & NodeFlags.Ambient && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
41535
41535
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
41536
41536
}
@@ -48184,7 +48184,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
48184
48184
targetFlags & SymbolFlags.ConstEnum
48185
48185
) {
48186
48186
const constEnumDeclaration = target.valueDeclaration as EnumDeclaration;
48187
- const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject (getSourceFileOfNode(constEnumDeclaration).resolvedPath);
48187
+ const redirect = host.getRedirectFromOutput (getSourceFileOfNode(constEnumDeclaration).resolvedPath)?.resolvedRef ;
48188
48188
if (constEnumDeclaration.flags & NodeFlags.Ambient && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
48189
48189
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
48190
48190
}
@@ -53374,7 +53374,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host: TypeCheckerHo
53374
53374
getPackageJsonInfoCache: () => host.getPackageJsonInfoCache?.(),
53375
53375
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
53376
53376
redirectTargetsMap: host.redirectTargetsMap,
53377
- getProjectReferenceRedirect : fileName => host.getProjectReferenceRedirect (fileName),
53377
+ getRedirectFromSourceFile : fileName => host.getRedirectFromSourceFile (fileName),
53378
53378
isSourceOfProjectReferenceRedirect: fileName => host.isSourceOfProjectReferenceRedirect(fileName),
53379
53379
fileExists: fileName => host.fileExists(fileName),
53380
53380
getFileIncludeReasons: () => host.getFileIncludeReasons(),
0 commit comments