Skip to content

Commit ef60613

Browse files
committed
Functions with type parameters are never contextsensitive
1 parent eac0738 commit ef60613

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14251,7 +14251,7 @@ namespace ts {
1425114251

1425214252
function hasContextSensitiveReturnExpression(node: FunctionLikeDeclaration) {
1425314253
// TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value.
14254-
return !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== SyntaxKind.Block && isContextSensitive(node.body);
14254+
return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== SyntaxKind.Block && isContextSensitive(node.body);
1425514255
}
1425614256

1425714257
function isContextSensitiveFunctionOrObjectLiteralMethod(func: Node): func is FunctionExpression | ArrowFunction | MethodDeclaration {

0 commit comments

Comments
 (0)