2
處理這種情況的正確方法是什麼?我在我的F#類DogTree中有一個方法應該滿足實現兩個接口的Bark()方法的要求。F#兩個接口的顯式接口方法
type ITree =
interface
abstract Bark : unit -> unit
abstract Grow : unit -> unit
end
type IDog =
interface
abstract Bark : unit -> unit
abstract ChaseCar : unit -> unit
end
type TreeDog =
// so the "and" syntax below doesn't work - what is the correct way to handle?
interface IDog and ITree with
member this.Bark() = printfn "Bark"