mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-02 23:26:03 -06:00
Revert strict containment check in checkInferType
This commit is contained in:
parent
09da98b185
commit
a75449cabc
@ -20605,8 +20605,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function checkInferType(node: InferTypeNode) {
|
||||
const ancestor = findAncestor(node, n => n.parent && n.parent.kind === SyntaxKind.ConditionalType);
|
||||
if (!ancestor || (<ConditionalTypeNode>ancestor.parent).extendsType !== ancestor) {
|
||||
if (!findAncestor(node, n => n.parent && n.parent.kind === SyntaxKind.ConditionalType && (<ConditionalTypeNode>n.parent).extendsType === n)) {
|
||||
grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
|
||||
}
|
||||
checkSourceElement(node.typeParameter);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user