mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Do not reset control flow analysis on index signatures (#48427)
* do not flag index signatures as a control flow container * add tests and baselines
This commit is contained in:
@@ -1818,6 +1818,7 @@ namespace ts {
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
case SyntaxKind.MappedType:
|
||||
case SyntaxKind.IndexSignature:
|
||||
return ContainerFlags.IsContainer | ContainerFlags.HasLocals;
|
||||
|
||||
case SyntaxKind.SourceFile:
|
||||
@@ -1838,7 +1839,6 @@ namespace ts {
|
||||
case SyntaxKind.JSDocFunctionType:
|
||||
case SyntaxKind.FunctionType:
|
||||
case SyntaxKind.ConstructSignature:
|
||||
case SyntaxKind.IndexSignature:
|
||||
case SyntaxKind.ConstructorType:
|
||||
case SyntaxKind.ClassStaticBlockDeclaration:
|
||||
return ContainerFlags.IsContainer | ContainerFlags.IsControlFlowContainer | ContainerFlags.HasLocals | ContainerFlags.IsFunctionLike;
|
||||
|
||||
Reference in New Issue
Block a user