How can I override an abstract method with a generic type signature, and give it a more specific parameter type in a subclass?
type Rule() =
abstract Core : 'T -> bool
default _.Core _ = false
type Entity = {
Name: string
State: string
}
type Wisconsin() =
inherit Rule()
override _.Core (entity: Entity) =
entity.State = "WI"
SimpleMemberOverload.fsx(256,22): error FS0001: This expression was expected to have type ''a' but here has type 'Entity'
Wisconsinas aRule, callingCorershould work with any type, not justEntity. - Panagiotis Kanavos