Adds a note about strictFunctionTypes to type compatibility PR1103

This commit is contained in:
zhongsp 2019-09-21 16:24:17 +08:00
parent 7142fb182e
commit f52e6f418a

View File

@ -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在这种情况下报错。
## 可选参数及剩余参数
比较函数兼容性的时候,可选参数与必须参数是可互换的。