Thanks to visit codestin.com Credit goes to github.com
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 852d14e commit 08ab517Copy full SHA for 08ab517
src/compiler/checker.ts
@@ -4379,7 +4379,7 @@ module ts {
4379
function getNarrowedTypeOfSymbol(symbol: Symbol, node: Node) {
4380
var type = getTypeOfSymbol(symbol);
4381
// Only narrow when symbol is variable of a structured type
4382
- if (node && (symbol.flags & SymbolFlags.Variable && type.flags & TypeFlags.Structured)) {
+ if (node && node.parent && (symbol.flags & SymbolFlags.Variable && type.flags & TypeFlags.Structured)) {
4383
loop: while (true) {
4384
var child = node;
4385
node = node.parent;
0 commit comments