@@ -789,7 +789,6 @@ namespace ts {
789
789
const wildcardType = createIntrinsicType(TypeFlags.Any, "any");
790
790
const errorType = createIntrinsicType(TypeFlags.Any, "error");
791
791
const unresolvedType = createIntrinsicType(TypeFlags.Any, "unresolved");
792
- const nonInferrableAnyType = createIntrinsicType(TypeFlags.Any, "any", ObjectFlags.ContainsWideningType);
793
792
const intrinsicMarkerType = createIntrinsicType(TypeFlags.Any, "intrinsic");
794
793
const unknownType = createIntrinsicType(TypeFlags.Unknown, "unknown");
795
794
const nonNullUnknownType = createIntrinsicType(TypeFlags.Unknown, "unknown");
@@ -9455,11 +9454,7 @@ namespace ts {
9455
9454
if (reportErrors && !declarationBelongsToPrivateAmbientMember(element)) {
9456
9455
reportImplicitAny(element, anyType);
9457
9456
}
9458
- // When we're including the pattern in the type (an indication we're obtaining a contextual type), we
9459
- // use the non-inferrable any type. Inference will never directly infer this type, but it is possible
9460
- // to infer a type that contains it, e.g. for a binding pattern like [foo] or { foo }. In such cases,
9461
- // widening of the binding pattern type substitutes a regular any for the non-inferrable any.
9462
- return includePatternInType ? nonInferrableAnyType : anyType;
9457
+ return anyType;
9463
9458
}
9464
9459
9465
9460
// Return the type implied by an object binding pattern
@@ -22493,7 +22488,6 @@ namespace ts {
22493
22488
// Both types have the NonInferrableType flag set.
22494
22489
const nonInferrable =
22495
22490
getObjectFlags(source) & ObjectFlags.NonInferrableType
22496
- || source === nonInferrableAnyType
22497
22491
|| (priority & InferencePriority.ReturnType && (source === autoType || source === autoArrayType))
22498
22492
|| isFromInferenceBlockedSource(source);
22499
22493
if (nonInferrable) {
0 commit comments