@@ -9504,7 +9504,7 @@ namespace ts {
9504
9504
}
9505
9505
}
9506
9506
else if (sourceSignatures.length === 1 && targetSignatures.length === 1) {
9507
- // For pure functions (functions with a single signature) we only erase type parameters for
9507
+ // For simple functions (functions with a single signature) we only erase type parameters for
9508
9508
// the comparable relation. Otherwise, if the source signature is generic, we instantiate it
9509
9509
// in the context of the target signature before checking the relationship. Ideally we'd do
9510
9510
// this regardless of the number of signatures, but the potential costs are prohibitive due
@@ -15037,10 +15037,10 @@ namespace ts {
15037
15037
// outer call expression. Effectively we just want a snapshot of whatever has been
15038
15038
// inferred for any outer call expression so far.
15039
15039
const instantiatedType = instantiateType(contextualType, cloneTypeMapper(getContextualMapper(node)));
15040
- // If the contextual type is a generic pure function type, we instantiate the type with
15041
- // its own type parameters and type arguments. This ensures that the type parameters are
15042
- // not erased to type any during type inference such that they can be inferred as actual
15043
- // types from the contextual type. For example:
15040
+ // If the contextual type is a generic function type with a single call signature, we
15041
+ // instantiate the type with its own type parameters and type arguments. This ensures that
15042
+ // the type parameters are not erased to type any during type inference such that they can
15043
+ // be inferred as actual types from the contextual type. For example:
15044
15044
// declare function arrayMap<T, U>(f: (x: T) => U): (a: T[]) => U[];
15045
15045
// const boxElements: <A>(a: A[]) => { value: A }[] = arrayMap(value => ({ value }));
15046
15046
// Above, the type of the 'value' parameter is inferred to be 'A'.
0 commit comments