次の機能がある場合:
let myFunc x y =
if y = 0 then 1
x
エラーが発生します:
Program.fs(58,17): error FS0001: This expression was expected to have type
unit
but here has type
int
コンパイラが int ではなく 'unit' を期待するのはなぜですか?
次の機能がある場合:
let myFunc x y =
if y = 0 then 1
x
エラーが発生します:
Program.fs(58,17): error FS0001: This expression was expected to have type
unit
but here has type
int
コンパイラが int ではなく 'unit' を期待するのはなぜですか?