Merge pull request #3175 from Microsoft/release-1.5

Merge release-1.5 into master
This commit is contained in:
Jason Freeman 2015-05-15 00:07:24 -07:00
commit 28c9ff1d84
3 changed files with 21 additions and 3 deletions

View file

@ -2408,7 +2408,16 @@ module ts {
function getTypeOfAlias(symbol: Symbol): Type {
let links = getSymbolLinks(symbol);
if (!links.type) {
links.type = getTypeOfSymbol(resolveAlias(symbol));
let targetSymbol = resolveAlias(symbol);
// It only makes sense to get the type of a value symbol. If the result of resolving
// the alias is not a value, then it has no type. To get the type associated with a
// type symbol, call getDeclaredTypeOfSymbol.
// This check is important because without it, a call to getTypeOfSymbol could end
// up recursively calling getTypeOfAlias, causing a stack overflow.
links.type = targetSymbol.flags & SymbolFlags.Value
? getTypeOfSymbol(targetSymbol)
: unknownType;
}
return links.type;
}

View file

@ -35,9 +35,9 @@ class FourSlashRunner extends RunnerBase {
this.tests = this.enumerateFiles(this.basePath, /\.ts/i, { recursive: false });
}
describe(this.testSuiteName, () => {
this.tests.forEach((fn: string) => {
fn = ts.normalizeSlashes(fn);
describe(fn, () => {
fn = ts.normalizeSlashes(fn);
var justName = fn.replace(/^.*[\\\/]/, '');
// Convert to relative path

View file

@ -0,0 +1,9 @@
///<reference path="fourslash.ts"/>
////namespace bar { }
////import bar = bar/**/;
goTo.marker();
verify.quickInfoIs(
`namespace bar
import bar = bar`);