Skip to content

Commit 716e136

Browse files
Only perform contextual identifier checks on identifiers.
1 parent b9a4758 commit 716e136

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/binder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,14 +2745,14 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
27452745
bindBlockScopedDeclaration(parentNode as Declaration, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes);
27462746
break;
27472747
}
2748+
checkContextualIdentifier(node as Identifier);
27482749
// falls through
27492750
case SyntaxKind.ThisKeyword:
27502751
// TODO: Why use `isExpression` here? both Identifier and ThisKeyword are expressions.
27512752
if (currentFlow && (isExpression(node) || parent.kind === SyntaxKind.ShorthandPropertyAssignment)) {
27522753
(node as Identifier | ThisExpression).flowNode = currentFlow;
27532754
}
2754-
// TODO: a `ThisExpression` is not an Identifier, this cast is unsound
2755-
return checkContextualIdentifier(node as Identifier);
2755+
break;
27562756
case SyntaxKind.QualifiedName:
27572757
if (currentFlow && isPartOfTypeQuery(node)) {
27582758
(node as QualifiedName).flowNode = currentFlow;

0 commit comments

Comments
 (0)