我有一个抽象类,有一个抽象成员.我想将此成员继承到不同的类,并使成员的覆盖静态.
像这样的东西:
[<AbstractClass>]
type Parent() = class
abstract member Att : int
end;;
type Son() = class
inherit Parent()
static override Att = 10
end;;
type Daughter() = class
inherit Parent()
static override Att = 20
end;;
Run Code Online (Sandbox Code Playgroud)
或者
[<AbstractClass>]
type Parent() = class
static abstract member Att : int
end;;
Run Code Online (Sandbox Code Playgroud)
要么
[<AbstractClass>]
type Parent() = class
abstract static member Att : int
end;;
Run Code Online (Sandbox Code Playgroud)
那么所有的儿子都会有Att = 10而且所有的女儿都会有Att = 20.这不起作用.
有没有办法让这项工作?