【发布时间】:2019-04-28 20:04:27
【问题描述】:
我目前正在尝试 Reason 并遇到一个我不理解的错误
这是我的代码:
let mult = (x:float, y:float):float => x * y;
当我用 BuckleScript 编译它时,我收到以下错误:
We've found a bug for you!
D:\1\bbl\orga\src\demo.re 1:40
1 Ôöé let mult = (a:float, b:float):float => a * b;
This has type:
float
But somewhere wanted:
int
You can convert a float to a int with int_of_float.If this is a literal, you want a number without a trailing dot (e.g. 20).
我不明白为什么编译器需要在这里将 float 转换为 int
【问题讨论】:
标签: types compiler-errors reason