Treat this as a constant reference for purpose of narrowing using aliased expressions (#54347)

This commit is contained in:
Mateusz Burzyński
2023-06-01 16:44:53 -07:00
committed by GitHub
parent d49a28534a
commit 2fb0267630
6 changed files with 184 additions and 19 deletions
+2
View File
@@ -26457,6 +26457,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function isConstantReference(node: Node): boolean {
switch (node.kind) {
case SyntaxKind.ThisKeyword:
return true;
case SyntaxKind.Identifier:
if (!isThisInTypeQuery(node)) {
const symbol = getResolvedSymbol(node as Identifier);