【发布时间】:2014-07-08 21:25:52
【问题描述】:
是否可以使用对象表达式在 F# 中使用接口来装饰对象。例如:
type IFoo = abstract member foo : string
type IBar = abstract member bar : string
let a = { new IFoo with member x.foo = "foo" }
/// Looking for a variation on the below that does compile, the below doesn't
let b = { a with
interface IBar with
member x.Bar = "bar" }
【问题讨论】:
标签: f#