Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是什么让第一个实现 KO ?
type IToto = abstract Toto : unit -> unit { new IToto with member this.Toto = fun () -> () } { new IToto with member this.Toto () = () }
FSharpFunc<unit, unit> Toto { get; }在编译表示中,函数类型的属性(编译为)和获取单位和返回单元的方法(编译为 )之间存在差异unit Toto()。
FSharpFunc<unit, unit> Toto { get; }
unit Toto()
第一个对象表达式实现了一个不同的接口:
type IToto = abstract Toto : (unit -> unit) // Note: Parentheses around the function type! { new IToto with member this.Toto = fun () -> () }