Skip to content

Commit a75449c

Browse files
committed
Revert strict containment check in checkInferType
1 parent 09da98b commit a75449c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20605,8 +20605,7 @@ namespace ts {
2060520605
}
2060620606

2060720607
function checkInferType(node: InferTypeNode) {
20608-
const ancestor = findAncestor(node, n => n.parent && n.parent.kind === SyntaxKind.ConditionalType);
20609-
if (!ancestor || (<ConditionalTypeNode>ancestor.parent).extendsType !== ancestor) {
20608+
if (!findAncestor(node, n => n.parent && n.parent.kind === SyntaxKind.ConditionalType && (<ConditionalTypeNode>n.parent).extendsType === n)) {
2061020609
grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
2061120610
}
2061220611
checkSourceElement(node.typeParameter);

0 commit comments

Comments
 (0)