Skip to content

Commit 8922a09

Browse files
committed
Only call getTypeOfSymbol recursively if it's a value
1 parent a8214ed commit 8922a09

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2414,7 +2414,10 @@ module ts {
24142414
function getTypeOfAlias(symbol: Symbol): Type {
24152415
let links = getSymbolLinks(symbol);
24162416
if (!links.type) {
2417-
links.type = getTypeOfSymbol(resolveAlias(symbol));
2417+
let targetSymbol = resolveAlias(symbol);
2418+
links.type = targetSymbol.flags & SymbolFlags.Value
2419+
? getTypeOfSymbol(targetSymbol)
2420+
: unknownType;
24182421
}
24192422
return links.type;
24202423
}

src/harness/fourslashRunner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class FourSlashRunner extends RunnerBase {
3535
this.tests = this.enumerateFiles(this.basePath, /\.ts/i, { recursive: false });
3636
}
3737

38-
describe(this.testSuiteName, () => {
3938
this.tests.forEach((fn: string) => {
40-
fn = ts.normalizeSlashes(fn);
39+
describe(fn, () => {
40+
fn = ts.normalizeSlashes(fn);
4141
var justName = fn.replace(/^.*[\\\/]/, '');
4242

4343
// Convert to relative path
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
///<reference path="fourslash.ts"/>
2+
3+
////namespace bar { }
4+
////import bar = bar/**/;
5+
6+
goTo.marker();
7+
verify.quickInfoIs(
8+
`namespace bar
9+
import bar = bar`);

0 commit comments

Comments
 (0)