The problem is that it
has type obj
as the list is an obj list
and obj
has no .Kind
member. You can use the parent type - like
let fruits : Fruit list = [new Fruit(); new Apple(); new Cherry()];;
val fruits : Fruit list = [FSI_0003+Fruit; FSI_0003+Apple; FSI_0003+Cherry]
and then access it with:
fruits.Head.Kind;;
val it : string = "I'm a tasty fruit!"