mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Generic functions are never context sensitive (#37811)
* Functions with type parameters are never contextsensitive * Add tests
This commit is contained in:
@@ -14251,7 +14251,7 @@ namespace ts {
|
||||
|
||||
function hasContextSensitiveReturnExpression(node: FunctionLikeDeclaration) {
|
||||
// TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value.
|
||||
return !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== SyntaxKind.Block && isContextSensitive(node.body);
|
||||
return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== SyntaxKind.Block && isContextSensitive(node.body);
|
||||
}
|
||||
|
||||
function isContextSensitiveFunctionOrObjectLiteralMethod(func: Node): func is FunctionExpression | ArrowFunction | MethodDeclaration {
|
||||
|
||||
Reference in New Issue
Block a user