File A:var x: number = 5;
File B:var x = function (): number { return 5; };
Error:Subsqeuent variable declarations must have same type.
Removing all references (///<reference path='/Scripts/example.ts' />
) has NO effect on my project. Everything still compiles, Intellisense still works. To my understanding, this is definitely not intended behavior. Any variable declared in any file is available in all files, like the one that caused the error above. I've been aware something weird was going on but I'm about to embark on a project where File B is going to have lots of variables of the same name as A, but they must remain separate. So this is an issue. But I can't find any reading on what's going on here. Everyone says you control Intellisense with the reference directive and you must use it.
Can't find anything about this in Project Settings>TypeScript, nor Tools>Options.