我试图使用PrintfFormat类型解析器的强制解析,它最初似乎适用,int但随后的相同方法string却不起作用...虽然float起作用了,所以我认为是Value / Ref类型问题,但后来尝试了bool,但没有成功。像String一样工作。
int与float工作,string与bool不!?
(ParseApply方法目前是虚拟实现)
type System.String with static member inline ParseApply (path:string) (fn: string -> ^b) : ^b = fn ""
type System.Int32 with static member inline ParseApply (path:string) (fn: int -> ^b) : ^b = fn 0
type System.Double with static member inline ParseApply (path:string) (fn: float -> ^b) : ^b = fn 0.
type System.Boolean with static member inline ParseApply (path:string) (fn: …Run Code Online (Sandbox Code Playgroud)