From d27f4d4f15e3bfc7fe4afe76b1ea73fe1be7d7e9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Jun 2017 15:39:24 -0700 Subject: [PATCH] Fix comments --- src/compiler/checker.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 879b73a20f7..9b9a2cbe00e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9504,7 +9504,7 @@ namespace ts { } } else if (sourceSignatures.length === 1 && targetSignatures.length === 1) { - // For pure functions (functions with a single signature) we only erase type parameters for + // For simple functions (functions with a single signature) we only erase type parameters for // the comparable relation. Otherwise, if the source signature is generic, we instantiate it // in the context of the target signature before checking the relationship. Ideally we'd do // this regardless of the number of signatures, but the potential costs are prohibitive due @@ -15037,10 +15037,10 @@ namespace ts { // outer call expression. Effectively we just want a snapshot of whatever has been // inferred for any outer call expression so far. const instantiatedType = instantiateType(contextualType, cloneTypeMapper(getContextualMapper(node))); - // If the contextual type is a generic pure function type, we instantiate the type with - // its own type parameters and type arguments. This ensures that the type parameters are - // not erased to type any during type inference such that they can be inferred as actual - // types from the contextual type. For example: + // If the contextual type is a generic function type with a single call signature, we + // instantiate the type with its own type parameters and type arguments. This ensures that + // the type parameters are not erased to type any during type inference such that they can + // be inferred as actual types from the contextual type. For example: // declare function arrayMap(f: (x: T) => U): (a: T[]) => U[]; // const boxElements: (a: A[]) => { value: A }[] = arrayMap(value => ({ value })); // Above, the type of the 'value' parameter is inferred to be 'A'.