我目前正在尝试 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).
我不明白为什么编译器需要把 afloat
变成一个int
here