@@ -233,9 +233,9 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
233233 filesByPath := make (map [tspath.Path ]* ast.SourceFile , totalFileCount )
234234 // stores 'filename -> file association' ignoring case
235235 // used to track cases when two file names differ only in casing
236- var filesByNameIgnoreCase map [string ]* ast. SourceFile
236+ var tasksSeenByNameIgnoreCase map [string ]* parseTask
237237 if loader .comparePathsOptions .UseCaseSensitiveFileNames {
238- filesByNameIgnoreCase = make (map [string ]* ast. SourceFile , totalFileCount )
238+ tasksSeenByNameIgnoreCase = make (map [string ]* parseTask , totalFileCount )
239239 }
240240
241241 loader .includeProcessor .fileIncludeReasons = make (map [tspath.Path ][]* FileIncludeReason , totalFileCount )
@@ -284,6 +284,15 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
284284 seen [data ] = task .normalizedFilePath
285285 }
286286
287+ if tasksSeenByNameIgnoreCase != nil {
288+ pathLowerCase := tspath .ToFileNameLowerCase (string (task .path ))
289+ if taskByIgnoreCase , ok := tasksSeenByNameIgnoreCase [pathLowerCase ]; ok {
290+ loader .includeProcessor .addProcessingDiagnosticsForFileCasing (taskByIgnoreCase .path , taskByIgnoreCase .normalizedFilePath , task .normalizedFilePath , includeReason )
291+ } else {
292+ tasksSeenByNameIgnoreCase [pathLowerCase ] = task
293+ }
294+ }
295+
287296 for _ , trace := range task .typeResolutionsTrace {
288297 loader .opts .Host .Trace (trace .Message , trace .Args ... )
289298 }
@@ -316,15 +325,6 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles {
316325 continue
317326 }
318327
319- if filesByNameIgnoreCase != nil {
320- pathLowerCase := tspath .ToFileNameLowerCase (string (path ))
321- if existingFile , ok := filesByNameIgnoreCase [pathLowerCase ]; ok {
322- loader .includeProcessor .addProcessingDiagnosticsForFileCasing (path , existingFile .FileName (), file .FileName (), includeReason )
323- } else {
324- filesByNameIgnoreCase [pathLowerCase ] = file
325- }
326- }
327-
328328 if task .libFile != nil {
329329 libFiles = append (libFiles , file )
330330 libFilesMap [path ] = task .libFile
0 commit comments