We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8922a09 commit 26f73d4Copy full SHA for 26f73d4
src/compiler/checker.ts
@@ -2415,6 +2415,12 @@ module ts {
2415
let links = getSymbolLinks(symbol);
2416
if (!links.type) {
2417
let targetSymbol = resolveAlias(symbol);
2418
+
2419
+ // It only makes sense to get the type of a value symbol. If the result of resolving
2420
+ // the alias is not a value, then it has no type. To get the type associated with a
2421
+ // type symbol, call getDeclaredTypeOfSymbol.
2422
+ // This check is important because without it, a call to getTypeOfSymbol could end
2423
+ // up recursively calling getTypeOfAlias, causing a stack overflow.
2424
links.type = targetSymbol.flags & SymbolFlags.Value
2425
? getTypeOfSymbol(targetSymbol)
2426
: unknownType;
0 commit comments