Only call getTypeOfSymbol recursively if it's a value

This commit is contained in:
Jason Freeman 2015-05-13 17:45:09 -07:00
parent a8214edcce
commit 8922a09039
3 changed files with 15 additions and 3 deletions

View File

@ -2414,7 +2414,10 @@ module ts {
function getTypeOfAlias(symbol: Symbol): Type {
let links = getSymbolLinks(symbol);
if (!links.type) {
links.type = getTypeOfSymbol(resolveAlias(symbol));
let targetSymbol = resolveAlias(symbol);
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`);