diff --git a/src/compiler/program.ts b/src/compiler/program.ts index aee66834a11..03305dd368d 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -894,7 +894,7 @@ namespace ts { return; } - const sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, currentDirectory); + const sourcePathComponents = getNormalizedPathComponents(getCanonicalFileName(sourceFile.fileName), currentDirectory); sourcePathComponents.pop(); // The base file name is not part of the common directory path if (!commonPathComponents) { @@ -903,9 +903,8 @@ namespace ts { return; } - const caseSensitive = host.useCaseSensitiveFileNames(); for (let i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { - if (caseSensitive ? commonPathComponents[i] !== sourcePathComponents[i] : commonPathComponents[i].toLocaleLowerCase() !== sourcePathComponents[i].toLocaleLowerCase()) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { if (i === 0) { // Failed to find any common path component return true;