什么是双变量参数? ~打字稿
What is bivariant parameter? ~ TypeScript
TypeScript 的文档也带有 Compiler Options, where the --strictFunctionTypes
is defined with its description. Unfortunately, can't get what is bivariant parameter. I tried to understand https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-function-parameters-bivariant。
"bivariant" 参数是一个既协变又逆变的参数。
TypeScript 2.6 release notes 很好地描述了 --strictFunctionTypes
编译器选项,因为这是支持它的第一个版本。
Under --strictFunctionTypes function type parameter positions are checked contravariantly instead of bivariantly. For some background on what variance means for function types check out What are covariance and contravariance?.
该引用中链接的这篇文章描述了协变和逆变之间的区别:
https://www.stephanboyer.com/post/132/what-are-covariance-and-contravariance
TypeScript 的文档也带有 Compiler Options, where the --strictFunctionTypes
is defined with its description. Unfortunately, can't get what is bivariant parameter. I tried to understand https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-function-parameters-bivariant。
"bivariant" 参数是一个既协变又逆变的参数。
TypeScript 2.6 release notes 很好地描述了 --strictFunctionTypes
编译器选项,因为这是支持它的第一个版本。
Under --strictFunctionTypes function type parameter positions are checked contravariantly instead of bivariantly. For some background on what variance means for function types check out What are covariance and contravariance?.
该引用中链接的这篇文章描述了协变和逆变之间的区别: https://www.stephanboyer.com/post/132/what-are-covariance-and-contravariance