mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Only call getTypeOfSymbol recursively if it's a value
This commit is contained in:
parent
a8214edcce
commit
8922a09039
@ -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;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
9
tests/cases/fourslash/aliasMergingWithNamespace.ts
Normal file
9
tests/cases/fourslash/aliasMergingWithNamespace.ts
Normal file
@ -0,0 +1,9 @@
|
||||
///<reference path="fourslash.ts"/>
|
||||
|
||||
////namespace bar { }
|
||||
////import bar = bar/**/;
|
||||
|
||||
goTo.marker();
|
||||
verify.quickInfoIs(
|
||||
`namespace bar
|
||||
import bar = bar`);
|
||||
Loading…
x
Reference in New Issue
Block a user