TSConfig
noStrictGenericChecks
TypeScript will unify type parameters when comparing two generic functions.
tsTry
typeA = <T ,U >(x :T ,y :U ) => [T ,U ];typeB = <S >(x :S ,y :S ) => [S ,S ];functionf (a :A ,b :B ) {b =a ; // OkType 'B' is not assignable to type 'A'. Types of parameters 'y' and 'y' are incompatible. Type 'U' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.2322Type 'B' is not assignable to type 'A'. Types of parameters 'y' and 'y' are incompatible. Type 'U' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.= a b ; // Error}
This flag can be used to remove that check.