所以;这段代码编译得很好(虽然我不建议运行它......):
let rec firstFunc () =
secondFunc ()
and secondFunc () =
firstFunc ()
但是!此代码没有:
let rec firstFunc () =
secondFunc ()
[<CompiledName "SecondFunc">]
and secondFunc () =
firstFunc ()
有没有办法解决这个限制?
最佳答案
你可以在和
后面加上属性,看起来编译正常。
let rec firstFunc () =
secondFunc ()
and [<CompiledName "SecondFunc">] secondFunc () =
firstFunc ()
关于f# - 我可以在 F# 中声明具有属性的相互递归函数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39207055/