Microsoft/TypeScript — pull request #1131 by sheetalkamat (2014-11-12 07:17:58+00:00)
Title:  Fix the relative path reference resolution

Compiler internally doesn't resolve the file paths to full disk paths unless necessary that results in reference resolution error when reading files that reference each other but aren't in same directory.
Eg.
src\ts\Manager\FieldManager.ts -- references ..\..\..\typings\tsd.ts
typings\tsd.ts -- reference ..\src\ts\Manager\FieldManager.ts

compiling FieldManager.ts from src\ts\Manager folder results in following reads
FieldManager.ts
..\..\..\typings\tsd.ts - as it is reference from fieldManager.ts
src\ts\Manager\FieldManager.ts as a normalized reference from tsd.ts but compiler doesn't know that this is same file as earlier read FieldManager.ts and ends up adding the text again and hence duplicate symbol errors

Fixed this by adding keeping track of disk resolved path -> SourceFile cache as well apart from just filename -> SourceFile cache when adding sourceFile to cache so if we try to lookup the same file with different relative path name, so we wouldn't end up creating multiple source files for references to the same file through different relative paths