2
"Automatically implemented properties are part of the initialization of a type, so they must be included before any other member definitions, just like let bindings and do bindings in a type definition"初始化在F#
自动实现的属性但是,如果我以后在类型声明中的其他普通member this.
性质把member val
的编译器不抱怨。没关系?
我正确地说,初始化一个对象时,而不是当属性第一次被调用时,该属性被初始化?
例如
member val = let printf "%A" "initializing"
3 with get, set
所以每次我创建一个对象,它会打印出“初始化时间?
你尝试运行呢? –