@@ -4719,7 +4719,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47194719 );
47204720 }
47214721 else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) {
4722- const redirect = host.getResolvedProjectReferenceToRedirect (sourceFile.path);
4722+ const redirect = host.getRedirectFromSourceFile (sourceFile.path)?.resolvedRef ;
47234723 if (redirect) {
47244724 const ignoreCase = !host.useCaseSensitiveFileNames();
47254725 const ownRootDir = host.getCommonSourceDirectory();
@@ -4814,9 +4814,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
48144814 if (moduleNotFoundError) {
48154815 // See if this was possibly a projectReference redirect
48164816 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);
48204820 return undefined;
48214821 }
48224822 }
@@ -41530,7 +41530,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4153041530 ) {
4153141531 Debug.assert(!!(type.symbol.flags & SymbolFlags.ConstEnum));
4153241532 const constEnumDeclaration = type.symbol.valueDeclaration as EnumDeclaration;
41533- const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject (getSourceFileOfNode(constEnumDeclaration).resolvedPath);
41533+ const redirect = host.getRedirectFromOutput (getSourceFileOfNode(constEnumDeclaration).resolvedPath)?.resolvedRef ;
4153441534 if (constEnumDeclaration.flags & NodeFlags.Ambient && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
4153541535 error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
4153641536 }
@@ -48184,7 +48184,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4818448184 targetFlags & SymbolFlags.ConstEnum
4818548185 ) {
4818648186 const constEnumDeclaration = target.valueDeclaration as EnumDeclaration;
48187- const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject (getSourceFileOfNode(constEnumDeclaration).resolvedPath);
48187+ const redirect = host.getRedirectFromOutput (getSourceFileOfNode(constEnumDeclaration).resolvedPath)?.resolvedRef ;
4818848188 if (constEnumDeclaration.flags & NodeFlags.Ambient && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
4818948189 error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
4819048190 }
@@ -53374,7 +53374,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host: TypeCheckerHo
5337453374 getPackageJsonInfoCache: () => host.getPackageJsonInfoCache?.(),
5337553375 useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
5337653376 redirectTargetsMap: host.redirectTargetsMap,
53377- getProjectReferenceRedirect : fileName => host.getProjectReferenceRedirect (fileName),
53377+ getRedirectFromSourceFile : fileName => host.getRedirectFromSourceFile (fileName),
5337853378 isSourceOfProjectReferenceRedirect: fileName => host.isSourceOfProjectReferenceRedirect(fileName),
5337953379 fileExists: fileName => host.fileExists(fileName),
5338053380 getFileIncludeReasons: () => host.getFileIncludeReasons(),
0 commit comments