What does ‘bivariant’ method checking mean and when does TypeScript use it?

TypeScript Professional Hard

TypeScript Professional — Hard

What does ‘bivariant’ method checking mean and when does TypeScript use it?

Key points

  • Bivariant method checking applies to methods defined with shorthand syntax
  • It allows both covariant and contravariant checking for assignments
  • Bivariant types are different from bivariant method checking
  • Function properties with '=>' syntax are checked contravariantly under strictFunctionTypes

Ready to go further?

Related questions