Ver código fonte

Adds a note about `strictFunctionTypes` to type compatibility PR1103

zhongsp 4 anos atrás
pai
commit
f52e6f418a
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      doc/handbook/Type Compatibility.md

+ 2 - 0
doc/handbook/Type Compatibility.md

@@ -135,6 +135,8 @@ listenEvent(EventType.Mouse, ((e: MouseEvent) => console.log(e.x + "," + e.y)) a
 listenEvent(EventType.Mouse, (e: number) => console.log(e));
 ```
 
+你可以使用`strictFunctionTypes`编译选项,使TypeScript在这种情况下报错。
+
 ## 可选参数及剩余参数
 
 比较函数兼容性的时候,可选参数与必须参数是可互换的。