diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 80f793cb50..dc31dfb521 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -919,9 +919,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 (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { if (i === 0) { // Failed to find any common path component return true;